feat: Add complete German (de) translation#531
Conversation
Add full German localization support to Mostro Mobile app with 894 translated strings.
## Changes
### New Files
- `lib/l10n/intl_de.arb` - Complete German translation (894 strings)
- `lib/generated/l10n_de.dart` - Auto-generated German localization class
### Modified Files
- `lib/generated/l10n.dart` - Updated with German locale support
## Translation Details
- **Locale**: de (German)
- **Translation Rate**: 100% (894/894 strings)
- **Style**: Informal address (Du/du/dein) - appropriate for target audience
- **Placeholders**: All 95 parameterized strings correctly translated
- **Technical Terms**: Bitcoin-specific terms (Sats, Lightning, Nostr, P2P) preserved
## Quality Assurance
✅ All translation keys present and matching English source
✅ All placeholders ({variable}) correctly maintained
✅ JSON format validated
✅ Generated Dart files compile without errors
✅ Natural German phrasing (not literal translations)
✅ Consistent terminology throughout
## Testing
- `flutter gen-l10n` - Successful
- `dart analyze` - No errors
- JSON validation - Passed
- Placeholder validation - Passed
## Integration
German is now automatically:
- Added to `supportedLocales` list
- Detected by `localeResolutionCallback`
- Available when device language is set to German
No manual configuration required - the app will automatically display German
when the device language is set to German.
## References
Translation follows guidelines from `docs/ADDING_NEW_LANGUAGE.md`
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
WalkthroughThis PR adds complete German localization support to the application by introducing a comprehensive German translation resource file and registering the German locale across language selection, background notification services, and the timeago library initialization. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~18 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (2)
lib/l10n/intl_de.arb (2)
1077-1086: Metadata block forrelayAddedUnreachableis misplaced.The
@relayAddedUnreachablemetadata block (lines 1078-1086) should immediately follow its corresponding string at line 1056, not appear aftermostroChangedResetMessage. While JSON parsing is unaffected by order, this breaks the conventional ARB structure and makes maintenance harder.♻️ Suggested reordering
Move the
@relayAddedUnreachableblock to immediately follow line 1056:"relayAddedUnreachable": "Relay hinzugefügt, scheint aber nicht erreichbar zu sein: {url}", + "@relayAddedUnreachable": { + "description": "Nachricht, wenn ein Relay hinzugefügt wurde, aber nicht antwortet", + "placeholders": { + "url": { + "type": "String", + "description": "Die hinzugefügte Relay URL" + } + } + }, "addRelayDialogTitle": "Relay hinzufügen",And remove it from its current location at lines 1078-1086.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/l10n/intl_de.arb` around lines 1077 - 1086, Move the misplaced ARB metadata for "relayAddedUnreachable" so it immediately follows its corresponding message string "relayAddedUnreachable" (instead of after "mostroChangedResetMessage"); remove the duplicate metadata block currently attached to "mostroChangedResetMessage" and insert the "@relayAddedUnreachable" object right after the "relayAddedUnreachable" entry so the description and placeholders are adjacent to the string they describe.
104-104: Minor formatting inconsistency: extra indentation.This line and several others (lines 201, 301, 501, 701, 901, 1101, 1301) have 8 spaces of indentation instead of the consistent 4 spaces used elsewhere. While JSON parsers ignore whitespace and this won't cause functional issues, fixing this would improve file consistency.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/l10n/intl_de.arb` at line 104, The "buyerInvoiceAccepted" entry has 8 spaces of leading indentation instead of the project's standard 4; update the indentation for "buyerInvoiceAccepted" (and the other similarly mis-indented entries) to 4 spaces so all JSON/ARB keys use consistent 4-space indentation throughout the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@lib/l10n/intl_de.arb`:
- Around line 1077-1086: Move the misplaced ARB metadata for
"relayAddedUnreachable" so it immediately follows its corresponding message
string "relayAddedUnreachable" (instead of after "mostroChangedResetMessage");
remove the duplicate metadata block currently attached to
"mostroChangedResetMessage" and insert the "@relayAddedUnreachable" object right
after the "relayAddedUnreachable" entry so the description and placeholders are
adjacent to the string they describe.
- Line 104: The "buyerInvoiceAccepted" entry has 8 spaces of leading indentation
instead of the project's standard 4; update the indentation for
"buyerInvoiceAccepted" (and the other similarly mis-indented entries) to 4
spaces so all JSON/ARB keys use consistent 4-space indentation throughout the
file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: af614c65-d251-457f-8832-32d19b04fee9
📒 Files selected for processing (1)
lib/l10n/intl_de.arb
Catrya
left a comment
There was a problem hiding this comment.
Hello @Walpurga03 welcome, and thank you for translating to German.
To make the PR more complete, do you think you could add German to the list of available languages? Also, the app should detect if the user's phone is set to German and use that language by default, as it currently does with the other languages.
If you think you can't do it, let me know, and I'll do it separately, no problem
- Added 'german' translation key to all language files (en, de, es, it, fr)
- Updated language_selector.dart to include German ('de') in available languages
- Added 'german' case to _getLocalizedLanguageName method
- German language now appears in the language selector dropdown
- Automatic detection already works via existing localeResolutionCallback
This completes the German language integration, making it fully accessible
to users through the UI language selector.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@lib/shared/widgets/language_selector.dart`:
- Line 16: The language selector added 'de' but the app never registers German
timeago messages, so update the _initializeTimeAgoLocalization() function in
lib/main.dart to register the German locale (use the timeago DeMessages
registration with the 'de' locale key) alongside the existing Spanish and
Italian registrations; ensure the call is invoked during startup so
relative-time formatting in the UI uses German instead of falling back to
English.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 935fec89-1748-4e4d-8a18-8cd27605ff82
📒 Files selected for processing (6)
lib/l10n/intl_de.arblib/l10n/intl_en.arblib/l10n/intl_es.arblib/l10n/intl_fr.arblib/l10n/intl_it.arblib/shared/widgets/language_selector.dart
🚧 Files skipped from review as they are similar to previous changes (1)
- lib/l10n/intl_de.arb
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@PR_DESCRIPTION.md`:
- Around line 87-88: The reviewer scope note is misleading: update the sentence
referencing generated files and "Only `lib/l10n/intl_de.arb` needs to be
reviewed" in PR_DESCRIPTION.md so it instructs reviewers to also check related
logic changes (e.g., the language selector component and other ARB updates)
rather than skipping them; rephrase to explicitly list or mention modified
source files (like language selector and ARB changes) alongside the generated
files so reviewers know to review both generated assets and modified logic/ARB
files.
PR_DESCRIPTION.md
Outdated
| - The generated files (`lib/generated/l10n_de.dart`, `lib/generated/l10n.dart`) are in `.gitignore` and will be auto-generated during build | ||
| - Only `lib/l10n/intl_de.arb` needs to be reviewed |
There was a problem hiding this comment.
Reviewer scope note is misleading.
Line 88 says only lib/l10n/intl_de.arb needs review, but earlier sections list other modified logic files (e.g., language selector and ARB updates). Please reword this so reviewers don’t skip relevant changes.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@PR_DESCRIPTION.md` around lines 87 - 88, The reviewer scope note is
misleading: update the sentence referencing generated files and "Only
`lib/l10n/intl_de.arb` needs to be reviewed" in PR_DESCRIPTION.md so it
instructs reviewers to also check related logic changes (e.g., the language
selector component and other ARB updates) rather than skipping them; rephrase to
explicitly list or mention modified source files (like language selector and ARB
changes) alongside the generated files so reviewers know to review both
generated assets and modified logic/ARB files.
|
Hi! I'd be happy to handle that. I'll add German to the language list and implement the default language detection. |
5d4f25a to
0a6c221
Compare
- Register German locale messages for timeago package - Ensures relative-time text (e.g., '2 hours ago') displays in German - Fixes CodeRabbit warning about missing German timeago locale
|
please @Walpurga03 remove the PR_DESCRIPTION.md file |
|
@Catrya Sorry, I can't find the file anymore, and I think I've deleted it |
@Walpurga03 right, now i cant see it any more. Just the last thing, i tested it and the background notification are in english, can you apply this small change? |
- Add SDe() case to language switch statements - Import l10n_de.dart for German localization class - Ensures background notifications display in German for German users - Fixes fallback to English for German language setting
Add full German localization support to Mostro Mobile app with 894 translated strings.
Changes
New Files
lib/l10n/intl_de.arb- Complete German translation (894 strings)lib/generated/l10n_de.dart- Auto-generated German localization classModified Files
lib/generated/l10n.dart- Updated with German locale supportTranslation Details
Quality Assurance
✅ All translation keys present and matching English source ✅ All placeholders ({variable}) correctly maintained ✅ JSON format validated
✅ Generated Dart files compile without errors
✅ Natural German phrasing (not literal translations) ✅ Consistent terminology throughout
Testing
flutter gen-l10n- Successfuldart analyze- No errorsIntegration
German is now automatically:
supportedLocaleslistlocaleResolutionCallbackNo manual configuration required - the app will automatically display German when the device language is set to German.
References
Translation follows guidelines from
docs/ADDING_NEW_LANGUAGE.mdSummary by CodeRabbit