Skip to content

l10n: translate three strings es, fr and th still held in English, and guard against copies - #724

Merged
abdulsaheel merged 2 commits into
OpenStrap:mainfrom
kurexw:l10n/english-copies
Nov 15, 2026
Merged

abdulsaheel merged 2 commits into
OpenStrap:mainfrom
kurexw:l10n/english-copies

Conversation

@kurexw

@kurexw kurexw commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Three translated catalogues hold an English phrase word for word. The coverage tests can't see that, because the key is present:

  • Spanish and French: the live strength screen's subtitle read "3 SETS" / "60 KG · 3 SETS" (activityLiveSetsCountSubtitle, activityLiveVolumeSetsSubtitle). Now "SERIE/SERIES" and "SÉRIE/SÉRIES", matching the German "SATZ/SÄTZE" and Russian "ПОДХОД".
  • Thai: the ECG screen was titled "Heart Screener" (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 lists fr:supplementVO2maxEst25e886, so it stays green whatever order this and #721 land in.

Testing

  • The guard fails on main (these 5 copies) and passes with the change.
  • ui2_screen_sweep_test and the tests touching the live strength and ECG screens pass.
  • flutter gen-l10n and flutter analyze are 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

  • Guard fails without the fix
  • Analyze clean

🤖 Generated with Claude Code

Summary by Sourcery

Replace the remaining untranslated catalogue strings and prevent future accidental English copies.

Bug Fixes:

  • Translate the remaining English strength-screen subtitles in Spanish and French and the ECG title in Thai.

Enhancements:

  • Add a localization test that detects unintended English phrase copies across all catalogues while allowing intentional matches.

Tests:

  • Add automated coverage for accidental English duplicates in translated ARB files.

…d guard against copies

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.

  • 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.

Share

@sourcery-ai

sourcery-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

UI

Replace the remaining English live-strength subtitles in Spanish and French and translate the Thai ECG screen title.

  • lib/l10n/app_es.arb L2256, L2270
  • lib/l10n/app_fr.arb L2244, L2258
  • lib/l10n/app_th.arb L12510

Tests

Add a guard that checks every locale catalogue for English phrases copied verbatim, with an explicit allow-list for intentional matches.

  • test/l10n_no_english_copies_test.dart L1-76

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread test/l10n_no_english_copies_test.dart Resolved
…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>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sourcery assessment

Approved.

@abdulsaheel
abdulsaheel merged commit 86011d9 into OpenStrap:main Nov 15, 2026
10 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.

2 participants