Repository navigation
l10n: translate three strings es, fr and th still held in English, and guard against copies - #724
Merged
Merged
Conversation
…d guard against copies Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Caution Review failedAn error occurred during the review process. Please try again later.
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. |
Reviewer's GuideUIReplace the remaining English live-strength subtitles in Spanish and French and translate the Thai ECG screen title.
TestsAdd a guard that checks every locale catalogue for English phrases copied verbatim, with an explicit allow-list for intentional matches.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="test/l10n_no_english_copies_test.dart" line_range="54" />
<code_context>
+ test('no translated catalogue copies an English phrase by accident', () {
+ final en = _arb('en');
+ final copies = <String>[];
+ for (final code in ['de', 'es', 'fr', 'hi', 'ru', 'th', 'zh']) {
+ final arb = _arb(code);
+ for (final key in en.keys) {
</code_context>
<issue_to_address>
**New locale translations escape checks**
When a locale is added without updating the test’s locale list, the hard-coded loop never calls `_arb` for the new catalogue, so identical English phrases in it go unchecked and the test passes.
Derive the locales to inspect from the ARB catalogues or `AppLocalizations.supportedLocales` instead of maintaining a fixed list.
Also at `test/l10n_no_english_copies_test.dart:55`.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: test/l10n_no_english_copies_test.dart:54
…ixed list A locale added later would otherwise go unchecked until someone remembered to extend the list. The seven current locales are still asserted present. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Three translated catalogues hold an English phrase word for word. The coverage tests can't see that, because the key is present:
activityLiveSetsCountSubtitle,activityLiveVolumeSetsSubtitle). Now "SERIE/SERIES" and "SÉRIE/SÉRIES", matching the German "SATZ/SÄTZE" and Russian "ПОДХОД".ecgHeartScreener). Now "ตรวจคัดกรองหัวใจ"; de, ru, zh and hi already translate it.New guard
test/l10n_no_english_copies_test.dart: for every locale, a phrase (longer than 12 characters, with a space) may not be identical to English unless its (locale, key) is on an explicit allow-list. The list has placeholder-only patterns, "Open Food Facts", units such as "{lo}–{hi} bpm", and the French words that are spelled the same ("Score (0–100)", "minutes"). It also listsfr:supplementVO2maxEst25e886, so it stays green whatever order this and #721 land in.Testing
main(these 5 copies) and passes with the change.ui2_screen_sweep_testand the tests touching the live strength and ECG screens pass.flutter gen-l10nandflutter analyzeare clean.Risks and rollback
Three string values and one test. Revert the commit to roll back. The ARB edits replace single lines, so they don't conflict with the appends in #720–#723.
Checklist
🤖 Generated with Claude Code
Summary by Sourcery
Replace the remaining untranslated catalogue strings and prevent future accidental English copies.
Bug Fixes:
Enhancements:
Tests: