Repository navigation
l10n(hi): translate the supplement catalogue, so 300 strings stop falling back to English - #723
Conversation
…ling back to English Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideData structuresAdds Hindi translations for the supplement catalogue so those strings no longer fall back to English.
TestsRemoves the supplement-key coverage exemption and adds checks that the catalogue reads in Hindi.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
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/hindi_coverage_test.dart" line_range="24" />
<code_context>
for (final k in arb('en').keys)
if (!k.startsWith('@') && !hindi.containsKey(k)) k,
];
- // Still to do: the supplement catalogue.
- missing.removeWhere((k) => k.startsWith('supplement'));
</code_context>
<issue_to_address>
**English copy passes coverage test**
When a future English key is added to `app_hi.arb` with its English source text as the value, `hindi.containsKey(k)` succeeds even when the Hindi value is copied verbatim from English, so the coverage test passes while that string still displays in English.
Add checks for untranslated values where English should be localized, using an explicit allowlist for technical strings that intentionally remain unchanged.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: test/hindi_coverage_test.dart:24
Summary
Hindi had none of the 300
supplement*strings that were added on Oct 7 (cc9dc10). de, ru and th have them. In a Hindi app these fell back to English across notifications ("Did you nap?", "Your recovery is ready"), progress lines ("Need {n} more nights", "Wear {n} more days to unlock"), the coach's action confirmations, lab marker names, chart descriptions for screen readers, and the metric explanations.hindi_coverage_testalready listed this as "Still to do: the supplement catalogue" and exempted it. This change translates all 300 and removes the exemption, so a future English-only key fails the test instead of silently showing English.Terms follow what
app_hi.arbalready uses: बैंड, स्ट्रेन (strain), रिकवरी, HRV, हृदय गति, आराम हृदय गति, सामान्य सीमा, वर्कआउट, जर्नल, जीवन संकेत, ब्रीफ़िंग, and the आप form. Where the existing strings mix unit spellings, I used the more common one (kg, kcal, मिली, किमी). Units and method citations (Cole–Kripke, Plews 2013, AN-2554…) keep their names, as in de and ru.The new entries are appended at the end of
app_hi.arb, and no existing line changed.Testing
hindi_coverage_test: the stricter test fails onmain(300 missing) and passes with this change. A new case pins two of the strings.{placeholders}.ui2_screen_sweep_test(14 screens × 8 locales × 1.0/2.0/3.1× text): no overflows.flutter gen-l10nandflutter analyzeare clean.I am not a native speaker, and Hindi is the one of the four I am least sure of. Please have a native speaker read it before merging, especially the longer metric explanations and the short labels (P/C/F macro letters are प्रो/का/व).
Risks and rollback
Strings only, no code paths. Revert the commit to roll back.
Checklist
Spanish is #720, French #721 and Chinese #722.
🤖 Generated with Claude Code
Summary by Sourcery
Translate the full supplement catalogue into Hindi and enforce complete Hindi localization coverage.
New Features:
Bug Fixes:
Enhancements:
Tests:
Summary by CodeRabbit