Skip to content

feat: Add complete German (de) translation#531

Merged
grunch merged 4 commits intoMostroP2P:mainfrom
Walpurga03:feature/add-german-translation
Mar 19, 2026
Merged

feat: Add complete German (de) translation#531
grunch merged 4 commits intoMostroP2P:mainfrom
Walpurga03:feature/add-german-translation

Conversation

@Walpurga03
Copy link
Contributor

@Walpurga03 Walpurga03 commented Mar 15, 2026

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

Summary by CodeRabbit

  • New Features
    • German language support is now available. Users can select German in the language settings to view the complete application interface, including all messages, notifications, and relative timestamps in German.

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`
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 15, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 917d19a8-cbb6-4659-827c-a5b7d478f596

📥 Commits

Reviewing files that changed from the base of the PR and between 5d4f25a and 0fee52a.

📒 Files selected for processing (2)
  • lib/features/notifications/services/background_notification_service.dart
  • lib/main.dart

Walkthrough

This 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

Cohort / File(s) Summary
German Translation Resource
lib/l10n/intl_de.arb
New German localization file with 1508 lines covering UI strings, order/dispute flows, onboarding, settings, chat, notifications, and incident-specific messages, each accompanied by corresponding metadata blocks.
Language Metadata Updates
lib/l10n/intl_en.arb, lib/l10n/intl_es.arb, lib/l10n/intl_fr.arb, lib/l10n/intl_it.arb
Added "german" translation entry to existing language lists in English ("German"), Spanish ("Alemán"), French ("Allemand"), and Italian ("Tedesco") localization files.
Language Registration
lib/shared/widgets/language_selector.dart, lib/features/notifications/services/background_notification_service.dart, lib/main.dart
Registered German locale support by adding language key mappings, locale case handlers, timeago initialization, and import statements across UI selection, notification services, and app initialization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~18 minutes

Possibly related PRs

Suggested reviewers

  • Catrya
  • grunch

Poem

🐰 Hoppy translations in German so fine,
"Guten Tag" now appears in every line,
From 'de' locale to timeago's chime,
Our app speaks Deutsch—what perfect timing! 🇩🇪

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat: Add complete German (de) translation' directly and accurately summarizes the main change—adding full German localization support to the application.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (2)
lib/l10n/intl_de.arb (2)

1077-1086: Metadata block for relayAddedUnreachable is misplaced.

The @relayAddedUnreachable metadata block (lines 1078-1086) should immediately follow its corresponding string at line 1056, not appear after mostroChangedResetMessage. While JSON parsing is unaffected by order, this breaks the conventional ARB structure and makes maintenance harder.

♻️ Suggested reordering

Move the @relayAddedUnreachable block 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

📥 Commits

Reviewing files that changed from the base of the PR and between d693cfe and bcc360e.

📒 Files selected for processing (1)
  • lib/l10n/intl_de.arb

Copy link
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Image

- 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.
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between bcc360e and 0a6c221.

📒 Files selected for processing (6)
  • lib/l10n/intl_de.arb
  • lib/l10n/intl_en.arb
  • lib/l10n/intl_es.arb
  • lib/l10n/intl_fr.arb
  • lib/l10n/intl_it.arb
  • lib/shared/widgets/language_selector.dart
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/l10n/intl_de.arb

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bd91b7a5-36c9-4c61-ad79-3ace8af9dcdb

📥 Commits

Reviewing files that changed from the base of the PR and between 0a6c221 and 5d4f25a.

📒 Files selected for processing (1)
  • PR_DESCRIPTION.md

Comment on lines +87 to +88
- 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

@Walpurga03
Copy link
Contributor Author

Hi! I'd be happy to handle that. I'll add German to the language list and implement the default language detection.

@Walpurga03 Walpurga03 force-pushed the feature/add-german-translation branch from 5d4f25a to 0a6c221 Compare March 16, 2026 18:57
- 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
@Catrya
Copy link
Member

Catrya commented Mar 16, 2026

please @Walpurga03 remove the PR_DESCRIPTION.md file

@Walpurga03
Copy link
Contributor Author

@Catrya Sorry, I can't find the file anymore, and I think I've deleted it

@Catrya
Copy link
Member

Catrya commented Mar 16, 2026

@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?
background_notification_service.dart has a language switch ('es' => SEs(), 'it' => SIt()) that's missing the 'de' case background notifications would fall back to English for German users. Needs a 'de' => SDe() entry there too.

- 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
Copy link
Member

@Catrya Catrya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK, great job @Walpurga03

Copy link
Member

@grunch grunch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@grunch grunch merged commit 0af6476 into MostroP2P:main Mar 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants