Skip to content

l10n: translate the current HRV, HRV-stability and breathing-rate method text, which every language showed in English since Oct 2 - #725

Merged
abdulsaheel merged 3 commits into
OpenStrap:mainfrom
kurexw:l10n/metric-method-copy
Nov 15, 2026
Merged

abdulsaheel merged 3 commits into
OpenStrap:mainfrom
kurexw:l10n/metric-method-copy

Conversation

@kurexw

@kurexw kurexw commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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.method is English and is translated on screen by localizedText, 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.

  • Three new keys (investigateMethodHrvRmssd, investigateMethodRespRate, investigateMethodHrvStability) with the current English and translations in all seven languages. They're inserted mid-file, before metricDetailSlotWithValue, 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. The investigate prefix keeps them inside copy_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.
  • New guard test/metric_spec_copy_translated_test.dart: for every spec in metric_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

  • The guard fails on main with exactly these three texts and passes with the change.
  • The 19 test files touching Investigate, metric detail or localizedText pass, together with the screen sweep (258 tests).
  • All language coverage and locale tests pass (130 tests).
  • flutter gen-l10n and flutter analyze are 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

  • Guard fails without the fix
  • Jargon guard still passes
  • Analyze clean

🤖 Generated with Claude Code

Summary by Sourcery

Restore localized Investigate method descriptions and prevent future metric copy changes from bypassing translations.

New Features:

  • Add current translations for the HRV, HRV stability, and respiratory-rate method descriptions across all supported languages.

Bug Fixes:

  • Restore localized Investigate method text after updated English descriptions no longer matched the existing translation mappings.

Enhancements:

  • Add coverage guarding metric titles, methods, and withholding reasons against silently falling back to English.

Tests:

  • Add a localization test covering translation reachability for all metric specifications.

Summary by CodeRabbit

  • New Features
    • Added Spanish translations for supplementary interface labels and accessibility descriptions, along with chart and health observations.
    • Spanish-language text is now available for coach messages, error messages, device and workout prompts, sleep and recovery explanations, settings, and measurement units.

…ling back to English

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

sourcery-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Data structures

Add the current English method descriptions and their translations to the localization catalogues for all supported languages.

  • lib/l10n/app_de.arb L1201-1203
  • lib/l10n/app_en.arb L5764-5775
  • lib/l10n/app_es.arb L1164-1166
  • lib/l10n/app_fr.arb L1164-1166
  • lib/l10n/app_hi.arb L1164-1166
  • lib/l10n/app_ru.arb L2521-2523
  • lib/l10n/app_th.arb L5622-5624
  • lib/l10n/app_zh.arb L1164-1166

Uses of the API

Replace the stale English-string lookups with mappings from the current HRV, HRV-stability, and breathing-rate descriptions to their new localization keys.

  • lib/l10n/display_text.dart L254-255, L351-352, L393-394

Tests

Add a guard that checks each metric's title, method, and withheld-reason text translates in at least one of German, Russian, or Thai.

  • test/metric_spec_copy_translated_test.dart L1-56

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

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

We 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 @coderabbitai full review.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The Spanish localization file adds translations for supplementary interface labels, accessibility descriptions, health and sleep explanations, coach messages, device prompts, settings, and units. One existing translation was relocated without a wording change.

Changes: Spanish localization

Layer / File(s) Summary
Add supplementary Spanish translations
lib/l10n/app_es.arb
Adds Spanish translations for supplementary UI and health-related text. Relocates bandStatusFirmwareLockedFix without changing its text.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Bug fix

Suggested reviewers: abdulsaheel, sourcery-ai

Merge Risk: Minimal · previous review ee8d9

This change adds Spanish translations so that previously untranslated strings no longer fall back to English. It has no logic changes and no identified merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names a real part of the change: translating the HRV, HRV-stability and breathing-rate method text that showed in English in every language. The objectives confirm this is the main change. T…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names a real part of the change: translating the HRV, HRV-stability and breathing-rate method text that showed in English in every language. The objectives confirm this is the main change. The title is long, and the changed file is a Spanish ARB file, which the title does not mention. Those points do not make the title unrelated.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: OpenStrap/edge
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: b8fbe00
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 6aee4266-58d3-4a9b-b30d-6b0a9921d4f9
Commits

Reviewing files that changed from the base of the PR and between b8fbe00 and ee8d9f0.

Files ignored due to path filters: 1

  • test/spanish_coverage_test.dart is excluded by !test/**
Files selected for processing: 1

  • lib/l10n/app_es.arb

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

@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 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


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

Comment thread test/spanish_coverage_test.dart Resolved
Comment thread test/spanish_coverage_test.dart Outdated
expect(missing, isEmpty);
});

test('the supplement catalogue reads in spanish', () {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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.`.

Comment thread test/spanish_coverage_test.dart Outdated
});

test('the supplement catalogue reads in spanish', () {
expect(es.supplementNeedNights(3), 'Faltan 3 noches más');

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 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`.

Comment thread test/spanish_coverage_test.dart Outdated
final en = lookupAppLocalizations(const Locale('en'));

test('spanish has every english string outside the two known gaps', () {
test('spanish has every english string', () {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

uvtqt and others added 2 commits November 15, 2026 12:52
…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>
kurexw pushed a commit to kurexw/edge that referenced this pull request Nov 15, 2026
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>
@kurexw

kurexw commented Nov 15, 2026

Copy link
Copy Markdown
Contributor Author

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

@abdulsaheel
abdulsaheel merged commit ad9968f 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