forked from ImranR98/Obtainium
-
Notifications
You must be signed in to change notification settings - Fork 3
Migrate away from easy_localization (#252) #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
omeritzics
wants to merge
54
commits into
main
Choose a base branch
from
localization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 39 commits
Commits
Show all changes
54 commits
Select commit
Hold shift + click to select a range
4362964
Migrate away from easy_localizartion
omeritzics 57b018d
Migrate away from easy_localization
omeritzics beab741
Update
omeritzics 13e7a1e
Migrate localization from easy_localization to Flutter gen-l10n
omeritzics 94549fd
Fix compilation errors: Replace AppLocalizations calls with hardcoded…
omeritzics e9e9d2d
Fix getInfoColumn return type in app.dart
omeritzics 80a2f12
Complete migration: Convert all 31 JSON translation files to ARB format
omeritzics 8459279
Fix compilation errors: Replace all tr() and plural() calls with hard…
omeritzics ff91d2c
Fix remaining AppLocalizations compilation errors
omeritzics 8127786
Fix all remaining AppLocalizations and compilation errors in settings…
omeritzics 3c43a52
Fix AppLocalizations import in security_disclaimer.dart
omeritzics 6ef6d82
Fix all remaining AppLocalizations compilation errors across entire c…
omeritzics 6bc9086
Fix AppLocalizations.of(context) calls in provider classes
omeritzics bbe6d7a
Fix all remaining syntax errors and string issues
omeritzics 50cf6e7
Fix remaining compilation errors in app.dart and home.dart
omeritzics 40fedda
Fix all remaining syntax errors and import conflicts
omeritzics 2644a54
Fix final compilation errors in providers
omeritzics fec742d
Fix all remaining compilation errors for successful build
omeritzics bbe9667
Try to fix
omeritzics 4241ba9
Fix errors
omeritzics ee9ebe6
Fix attempt
omeritzics 0525e3f
Fix
omeritzics aba377a
Update main.dart
omeritzics 90b06c3
Fix tests
omeritzics 967f2af
Fix & remove unused imports
omeritzics a85b283
Commit fix
omeritzics d20fe23
Update apps.dart
omeritzics c6e5cc2
Fix Import/Export page not being translated
omeritzics ae72269
Update
omeritzics 13cada0
Commit
omeritzics 1bab627
Fix
omeritzics fcc1432
Update buttons
omeritzics a82a22b
Update apps.dart
omeritzics 8e90c8b
Fix attempt
omeritzics b3d7df2
Update add_app.dart
omeritzics f4f45f0
Add missing strings
omeritzics 7b76f8e
Add more missing strings
omeritzics df68d6b
Add missing strings
omeritzics 92d8183
Commit
omeritzics ed5ab1c
Update .github/workflows/auto_localization.yml
omeritzics aa7dbee
Fix
omeritzics ca1a7ab
Fix string
omeritzics 19f3a3a
Update
omeritzics 08d9773
Fix2
omeritzics 8bb4b95
Merge branch 'main' into localization
omeritzics d575400
Fix
omeritzics b0dc069
Another commit
omeritzics fbd1a54
Add missing strings
omeritzics 50b94d2
Fix
omeritzics 2111490
Merge branch 'main' into localization
omeritzics a8e5e90
Fix 2
omeritzics e52e37e
Merge branch 'main' into localization
omeritzics 2ed4aa2
Merge branch 'main' into localization
omeritzics 7e93c2c
Merge branch 'main' into localization
omeritzics File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,104 @@ | ||
| name: Auto Update Localization | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main, develop ] | ||
| paths: | ||
| - 'lib/l10n/app_en.arb' | ||
| - '.github/workflows/auto_localization.yml' | ||
| - 'scripts/update_localization.py' | ||
| workflow_dispatch: | ||
| inputs: | ||
| dry_run: | ||
| description: 'Dry run (no commits)' | ||
| required: false | ||
| default: 'false' | ||
| type: boolean | ||
|
|
||
| jobs: | ||
| update-localization: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| token: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Setup Python | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: '3.11' | ||
|
|
||
| - name: Setup Flutter | ||
| uses: subosito/flutter-action@v2 | ||
| with: | ||
| flutter-version: '3.41.4' | ||
| channel: 'stable' | ||
|
|
||
| - name: Get Flutter dependencies | ||
| run: flutter pub get | ||
|
|
||
| - name: Make script executable | ||
| run: chmod +x scripts/update_localization.py | ||
|
|
||
| - name: Update localization files | ||
| run: | | ||
| python3 scripts/update_localization.py | ||
|
|
||
| - name: Generate localization files | ||
| run: flutter gen-l10n | ||
|
|
||
| - name: Check for changes | ||
| id: verify-changed | ||
| run: | | ||
| if [ -n "$(git status --porcelain)" ]; then | ||
| echo "changed=true" >> $GITHUB_OUTPUT | ||
| echo "Changes detected:" | ||
| git status --porcelain | ||
| else | ||
| echo "changed=false" >> $GITHUB_OUTPUT | ||
| echo "No changes detected" | ||
| fi | ||
|
|
||
| - name: Commit and push changes | ||
| if: steps.verify-changed.outputs.changed == 'true' && github.event.inputs.dry_run != 'true' | ||
| run: | | ||
| git config --local user.email "action@github.com" | ||
| git config --local user.name "GitHub Action" | ||
| git add lib/l10n/ lib/generated/ | ||
| git commit -m "🌐 Auto-update localization files | ||
|
|
||
| - Add missing keys to all ARB files | ||
| - Regenerate AppLocalizations files | ||
| - Sync with English master file | ||
|
|
||
| 🤖 Generated by GitHub Actions" | ||
| git push | ||
|
|
||
| - name: Create summary | ||
| run: | | ||
| echo "## 🌐 Localization Update Summary" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| if [ "${{ steps.verify-changed.outputs.changed }}" == "true" ]; then | ||
| echo "✅ **Localization files updated successfully!**" >> $GITHUB_STEP_SUMMARY | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### 📝 Changes made:" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Added missing keys to ARB files" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Regenerated AppLocalizations files" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Synced all translations with English master" >> $GITHUB_STEP_SUMMARY | ||
| else | ||
| echo "ℹ️ **No changes needed** - all localization files are up to date" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
|
|
||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "### 📊 Files processed:" >> $GITHUB_STEP_SUMMARY | ||
| echo "- English ARB (master): app_en.arb" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Target ARB files: 31 languages" >> $GITHUB_STEP_SUMMARY | ||
| echo "- Generated files: app_localizations_*.dart" >> $GITHUB_STEP_SUMMARY | ||
|
|
||
| if [ "${{ github.event.inputs.dry_run }}" == "true" ]; then | ||
| echo "" >> $GITHUB_STEP_SUMMARY | ||
| echo "⚠️ **Dry run mode** - no changes were committed" >> $GITHUB_STEP_SUMMARY | ||
| fi | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.