Repository navigation
l10n: translate the current HRV, HRV-stability and breathing-rate method text, which every language showed in English since Oct 2 - #725
Conversation
…ling back to English Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reviewer's GuideData structuresAdd the current English method descriptions and their translations to the localization catalogues for all supported languages.
Uses of the APIReplace the stale English-string lookups with mappings from the current HRV, HRV-stability, and breathing-rate descriptions to their new localization keys.
TestsAdd a guard that checks each metric's title, method, and withheld-reason text translates in at least one of German, Russian, or Thai.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Important Review skippedWe couldn't safely recover the incremental review. No full review was started, and the last reviewed checkpoint was preserved. Retry later, or explicitly request a full review by commenting You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
Hey - I've found 4 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="test/spanish_coverage_test.dart" line_range="26" />
<code_context>
- missing.removeWhere((k) =>
- k.startsWith('supplement') || k.startsWith('whoopFirmwareWarning'));
expect(missing, isEmpty);
});
+ test('the supplement catalogue reads in spanish', () {
</code_context>
<issue_to_address>
**Current method text remains English**
When the Investigate screen renders one of these methods in a non-English locale, `uiText` sends the current HRV, respiratory-rate, and HRV-stability method strings to `localizedText`, but the switch has no matching cases for them, so it returns the English input and users see English on the Investigate screen.
Add the current method strings to the localization lookup and provide their translations in each supported locale.
</issue_to_address>
### Comment 2
<location path="test/spanish_coverage_test.dart" line_range="28" />
<code_context>
expect(missing, isEmpty);
});
+ test('the supplement catalogue reads in spanish', () {
+ expect(es.supplementNeedNights(3), 'Faltan 3 noches más');
+ expect(es.supplementNeedDays(2), 'Lleva la banda 2 días más para desbloquearlo');
</code_context>
<issue_to_address>
**Dose reminder gives the wrong instruction**
When a Spanish-speaking user receives a medication reminder, `localizedNotificationText` maps the medication reminder to this Spanish string, which tells users to tap a dose rather than saying that a dose is due; the lock-screen reminder is misleading.
Translate the reminder as a due-time notification, for example `Es hora de una dosis.`.
</issue_to_address>
### Comment 3
<location path="test/spanish_coverage_test.dart" line_range="29" />
<code_context>
});
+ test('the supplement catalogue reads in spanish', () {
+ expect(es.supplementNeedNights(3), 'Faltan 3 noches más');
+ expect(es.supplementNeedDays(2), 'Lleva la banda 2 días más para desbloquearlo');
+ expect(es.supplementDidYouNapccbced, isNot(en.supplementDidYouNapccbced));
</code_context>
<issue_to_address>
**Singular counts use plural wording**
When the remaining count is exactly one, `supplementNeedNights` and `supplementNeedDays` use fixed plural wording from `app_es.arb`, so users see “1 noches” or “1 días.”
Use Spanish singular wording when the remaining count is one.
Also at `test/spanish_coverage_test.dart:30`.
</issue_to_address>
### Comment 4
<location path="test/spanish_coverage_test.dart" line_range="16" />
<code_context>
final en = lookupAppLocalizations(const Locale('en'));
- test('spanish has every english string outside the two known gaps', () {
+ test('spanish has every english string', () {
Map<String, dynamic> arb(String code) =>
jsonDecode(File('lib/l10n/app_$code.arb').readAsStringSync())
</code_context>
<issue_to_address>
**English copy passes Spanish coverage guard**
When a Spanish ARB value is accidentally replaced with its English source while the key remains present, an English sentence copied into an existing Spanish ARB key remains present in the catalogue, so `missing` stays empty and this test passes while Spanish users see English. The three spot checks do not cover the catalogue’s other entries.
Add a value-level check for catalogue entries, with an explicit allowlist for legitimately identical translations.
</issue_to_address>Sourcery assessment
Approval pending. 4 findings to address first.
Blocking findings: test/spanish_coverage_test.dart:26, test/spanish_coverage_test.dart:28, test/spanish_coverage_test.dart:29, test/spanish_coverage_test.dart:16
| expect(missing, isEmpty); | ||
| }); | ||
|
|
||
| test('the supplement catalogue reads in spanish', () { |
There was a problem hiding this comment.
🟡 Medium · Dose reminder gives the wrong instruction
When a Spanish-speaking user receives a medication reminder, localizedNotificationText maps the medication reminder to this Spanish string, which tells users to tap a dose rather than saying that a dose is due; the lock-screen reminder is misleading.
Translate the reminder as a due-time notification, for example Es hora de una dosis..
Prompt for AI agents
In `test/spanish_coverage_test.dart` at line 28:
**Dose reminder gives the wrong instruction**
When a Spanish-speaking user receives a medication reminder, `localizedNotificationText` maps the medication reminder to this Spanish string, which tells users to tap a dose rather than saying that a dose is due; the lock-screen reminder is misleading.
Translate the reminder as a due-time notification, for example `Es hora de una dosis.`.| }); | ||
|
|
||
| test('the supplement catalogue reads in spanish', () { | ||
| expect(es.supplementNeedNights(3), 'Faltan 3 noches más'); |
There was a problem hiding this comment.
🟡 Medium · Singular counts use plural wording
When the remaining count is exactly one, supplementNeedNights and supplementNeedDays use fixed plural wording from app_es.arb, so users see “1 noches” or “1 días.”
Use Spanish singular wording when the remaining count is one.
Also at test/spanish_coverage_test.dart:30.
Prompt for AI agents
In `test/spanish_coverage_test.dart` at line 29:
**Singular counts use plural wording**
When the remaining count is exactly one, `supplementNeedNights` and `supplementNeedDays` use fixed plural wording from `app_es.arb`, so users see “1 noches” or “1 días.”
Use Spanish singular wording when the remaining count is one.
Also at `test/spanish_coverage_test.dart:30`.| final en = lookupAppLocalizations(const Locale('en')); | ||
|
|
||
| test('spanish has every english string outside the two known gaps', () { | ||
| test('spanish has every english string', () { |
There was a problem hiding this comment.
🟡 Medium · English copy passes Spanish coverage guard
When a Spanish ARB value is accidentally replaced with its English source while the key remains present, an English sentence copied into an existing Spanish ARB key remains present in the catalogue, so missing stays empty and this test passes while Spanish users see English. The three spot checks do not cover the catalogue’s other entries.
Add a value-level check for catalogue entries, with an explicit allowlist for legitimately identical translations.
Prompt for AI agents
In `test/spanish_coverage_test.dart` at line 16:
**English copy passes Spanish coverage guard**
When a Spanish ARB value is accidentally replaced with its English source while the key remains present, an English sentence copied into an existing Spanish ARB key remains present in the catalogue, so `missing` stays empty and this test passes while Spanish users see English. The three spot checks do not cover the catalogue’s other entries.
Add a value-level check for catalogue entries, with an explicit allowlist for legitimately identical translations.…take It belongs to OpenStrap#720. This PR only carries the method-text fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hod text, which every language showed in English since Oct 2 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It belongs to OpenStrap#725. This PR only carries the ChatGPT sign-in and alarm fix. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Housekeeping: a commit from #720 landed on this branch by mistake. It's reverted here rather than force-pushed, so the net diff is only the method-text fix (squash-merge recommended). |
Summary
The Investigate screen's method text for HRV, HRV stability and respiratory rate has shown in English in every language since Oct 2, German and Russian included.
MetricSpec.methodis English and is translated on screen bylocalizedText, which looks the English up verbatim. 9b780d7 and 942f806 rewrote these three texts to describe the estimators that actually ship (mean of 5-minute RMSSD windows instead of the single longest window, within-night SDNN % instead of night-to-night CV of RMSSD, and the overlapping-stretch Lomb–Scargle breathing rate). The map kept the old wording, so the new text never matched. The catalogue still holds translations of the old method descriptions, so even a fixed lookup to those keys would describe a method the app no longer uses.investigateMethodHrvRmssd,investigateMethodRespRate,investigateMethodHrvStability) with the current English and translations in all seven languages. They're inserted mid-file, beforemetricDetailSlotWithValue, so they don't collide with the end-of-file appends in l10n(es): translate the supplement catalogue, so 300 strings stop falling back to English #720–l10n(hi): translate the supplement catalogue, so 300 strings stop falling back to English #723. Theinvestigateprefix keeps them insidecopy_jargon_guard_test's method-sheet allowance, since they name RMSSD and SDNN.display_text.dart: the three dead entries (old English, matched by nothing) now map the current English to the new keys.test/metric_spec_copy_translated_test.dart: for every spec inmetric_detail.dart, the title, method and withheld-reason texts must translate in at least one of de/ru/th. That means the next reword of the English fails a test instead of falling back to English. Words that are legitimately the same in one language, like German "HRV", still pass; "LF / HF" is the one universal exception.The old
supplement*keys for the previous wording are now unused. I left them in place because removing them would touch all eight catalogues and conflict with #720–#723; they can go in a cleanup once those land.Testing
mainwith exactly these three texts and passes with the change.localizedTextpass, together with the screen sweep (258 tests).flutter gen-l10nandflutter analyzeare clean.I'm not a native speaker of these languages, and these are long technical paragraphs, so a read by native speakers would help.
Risks and rollback
Copy and lookup only, no metric logic. Revert the commit to roll back.
Checklist
🤖 Generated with Claude Code
Summary by Sourcery
Restore localized Investigate method descriptions and prevent future metric copy changes from bypassing translations.
New Features:
Bug Fixes:
Enhancements:
Tests:
Summary by CodeRabbit