Repository navigation
fix(localization): translate the German mute strings and name both mute states - #3107
RaphaelFakhri wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
German mute strings and toggle validation packages/stream_chat_localizations/lib/src/stream_chat_localizations_de.dart, packages/stream_chat_localizations/test/translations_test.dart, packages/stream_chat_localizations/CHANGELOG.md |
The German localization now uses German text for the file-read error and mute-related actions and prompts. The user mute action returns an unmute label when muted. Tests check that both variants differ across supported languages. The changelog records the fixes. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related issues
- German mute strings are in Dutch, and "mute user" never changes to "unmute" #3106: Reports German localization defects addressed by this change.
Suggested reviewers: velikovpetar
Merge Risk: 
Minimal · up to 1f08d
-
The German translations correctly distinguish mute and unmute actions, with regression assertions covering every supported language. The change is ready to merge subject to normal test checks.
Pre-merge checks: 
5
-
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files. (2 skipped: 2 unsupported.)
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3107 +/- ##
==========================================
+ Coverage 80.28% 80.44% +0.16%
==========================================
Files 455 455
Lines 29614 29637 +23
==========================================
+ Hits 23775 23842 +67
+ Misses 5839 5795 -44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
xsahil03x
left a comment
There was a problem hiding this comment.
Thanks for the fix. The German strings read well and follow the file's existing wording (the formal "Sind Sie sicher, dass Sie … wollen?" form, stummgeschaltet, and the same short form as Blockierung aufheben / Benutzer blockieren). The new test would have caught the bug on master.
Approving. The two inline comments are nits: the changelog line should say the fix is German-only, and the test should use the same variable name as the rest of the file.
Before we can merge, please sign the CLA and tick the box in the description.
|
|
||
| 🐞 Fixed | ||
|
|
||
| - Fixed the German mute strings showing Dutch text, and the message action showing "mute" for a user who is already muted. |
There was a problem hiding this comment.
As written, the second half of this line sounds like it applies to every language, but only German was affected. Suggest naming German in both halves:
| - Fixed the German mute strings showing Dutch text, and the message action showing "mute" for a user who is already muted. | |
| - Fixed German mute strings showing Dutch text, and the German "Mute user" action not switching to "unmute" for an already-muted user. |
| test('mute and block toggles name both states in $language', () async { | ||
| final l = await GlobalStreamChatLocalizations.delegate.load(Locale(language)); | ||
|
|
||
| // Each toggle labels an action that flips state, so its two strings must differ. | ||
| final toggles = { | ||
| 'toggleMuteUnmuteAction': (l.toggleMuteUnmuteAction(isMuted: true), l.toggleMuteUnmuteAction(isMuted: false)), | ||
| 'toggleMuteUnmuteGroupQuestion': ( | ||
| l.toggleMuteUnmuteGroupQuestion(isMuted: true), | ||
| l.toggleMuteUnmuteGroupQuestion(isMuted: false), | ||
| ), | ||
| 'toggleMuteUnmuteGroupText': ( | ||
| l.toggleMuteUnmuteGroupText(isMuted: true), | ||
| l.toggleMuteUnmuteGroupText(isMuted: false), | ||
| ), | ||
| 'toggleMuteUnmuteUserQuestion': ( | ||
| l.toggleMuteUnmuteUserQuestion(isMuted: true), | ||
| l.toggleMuteUnmuteUserQuestion(isMuted: false), | ||
| ), | ||
| 'toggleMuteUnmuteUserText': ( | ||
| l.toggleMuteUnmuteUserText(isMuted: true), | ||
| l.toggleMuteUnmuteUserText(isMuted: false), | ||
| ), | ||
| 'toggleBlockUnblockUserText': ( | ||
| l.toggleBlockUnblockUserText(isBlocked: true), | ||
| l.toggleBlockUnblockUserText(isBlocked: false), | ||
| ), | ||
| }; | ||
|
|
||
| for (final MapEntry(key: name, value: (on, off)) in toggles.entries) { | ||
| expect(on, isNot(off), reason: '$name should differ between its two states'); | ||
| } |
There was a problem hiding this comment.
Nit: the rest of this file calls the loaded object localizations, so l stands out. I've also reworded the test name so it states the expected result. That way a failure in the flutter test output explains itself, which the testing guide asks for.
| test('mute and block toggles name both states in $language', () async { | |
| final l = await GlobalStreamChatLocalizations.delegate.load(Locale(language)); | |
| // Each toggle labels an action that flips state, so its two strings must differ. | |
| final toggles = { | |
| 'toggleMuteUnmuteAction': (l.toggleMuteUnmuteAction(isMuted: true), l.toggleMuteUnmuteAction(isMuted: false)), | |
| 'toggleMuteUnmuteGroupQuestion': ( | |
| l.toggleMuteUnmuteGroupQuestion(isMuted: true), | |
| l.toggleMuteUnmuteGroupQuestion(isMuted: false), | |
| ), | |
| 'toggleMuteUnmuteGroupText': ( | |
| l.toggleMuteUnmuteGroupText(isMuted: true), | |
| l.toggleMuteUnmuteGroupText(isMuted: false), | |
| ), | |
| 'toggleMuteUnmuteUserQuestion': ( | |
| l.toggleMuteUnmuteUserQuestion(isMuted: true), | |
| l.toggleMuteUnmuteUserQuestion(isMuted: false), | |
| ), | |
| 'toggleMuteUnmuteUserText': ( | |
| l.toggleMuteUnmuteUserText(isMuted: true), | |
| l.toggleMuteUnmuteUserText(isMuted: false), | |
| ), | |
| 'toggleBlockUnblockUserText': ( | |
| l.toggleBlockUnblockUserText(isBlocked: true), | |
| l.toggleBlockUnblockUserText(isBlocked: false), | |
| ), | |
| }; | |
| for (final MapEntry(key: name, value: (on, off)) in toggles.entries) { | |
| expect(on, isNot(off), reason: '$name should differ between its two states'); | |
| } | |
| test('mute and block toggles return different text for each state in $language', () async { | |
| final localizations = await GlobalStreamChatLocalizations.delegate.load(Locale(language)); | |
| // Each toggle labels an action that flips state, so its two strings must differ. | |
| final toggles = { | |
| 'toggleMuteUnmuteAction': ( | |
| localizations.toggleMuteUnmuteAction(isMuted: true), | |
| localizations.toggleMuteUnmuteAction(isMuted: false), | |
| ), | |
| 'toggleMuteUnmuteGroupQuestion': ( | |
| localizations.toggleMuteUnmuteGroupQuestion(isMuted: true), | |
| localizations.toggleMuteUnmuteGroupQuestion(isMuted: false), | |
| ), | |
| 'toggleMuteUnmuteGroupText': ( | |
| localizations.toggleMuteUnmuteGroupText(isMuted: true), | |
| localizations.toggleMuteUnmuteGroupText(isMuted: false), | |
| ), | |
| 'toggleMuteUnmuteUserQuestion': ( | |
| localizations.toggleMuteUnmuteUserQuestion(isMuted: true), | |
| localizations.toggleMuteUnmuteUserQuestion(isMuted: false), | |
| ), | |
| 'toggleMuteUnmuteUserText': ( | |
| localizations.toggleMuteUnmuteUserText(isMuted: true), | |
| localizations.toggleMuteUnmuteUserText(isMuted: false), | |
| ), | |
| 'toggleBlockUnblockUserText': ( | |
| localizations.toggleBlockUnblockUserText(isBlocked: true), | |
| localizations.toggleBlockUnblockUserText(isBlocked: false), | |
| ), | |
| }; | |
| for (final MapEntry(key: name, value: (on, off)) in toggles.entries) { | |
| expect(on, isNot(off), reason: '$name should differ between its two states'); | |
| } | |
| }); |
Submit a pull request
Linear: FLU-
Github Issue: #3106
CLA
Description of the pull request
The German translations returned Dutch text for the mute strings and for
couldNotReadBytesFromFileError.toggleMuteUnmuteUserTextalso ignoredisMuted. It labels the mute action in the message actions menu, so a German user sawGebruiker dempenfor both muting and unmuting someone.This PR replaces those strings with German. The wording follows the existing German strings: the formal "Sie" questions,
stummgeschaltet, andBenutzer blockieren/Blockierung aufheben.toggleMuteUnmuteUserTextnow returnsStummschaltung aufhebenwhen the user is muted andBenutzer stummschaltenotherwise.A new test in
translations_test.dartchecks, for every supported locale, that each mute and block toggle returns different text for its two states. Before the fix, it fails fordeontoggleMuteUnmuteUserText.To test:
Screenshots / Videos
de:Gebruiker dempen(also when the user is already muted)Benutzer stummschalten, orStummschaltung aufhebenwhen the user is mutedSummary by CodeRabbit