Skip to content

l10n: translate the ChatGPT sign-in flow and an alarm status, which showed English in every language - #726

Merged
abdulsaheel merged 4 commits into
OpenStrap:mainfrom
kurexw:l10n/chatgpt-signin
Nov 15, 2026
Merged

abdulsaheel merged 4 commits into
OpenStrap:mainfrom
kurexw:l10n/chatgpt-signin

Conversation

@kurexw

@kurexw kurexw commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The coach's ChatGPT sign-in flow (#602) passes its copy through uiText, but none of the 21 strings has an entry in localizedText, so the whole flow shows English in every language. That includes the data-sharing notice (questions and rows go to OpenAI under the user's ChatGPT account, where model-training controls may apply) and the "Before you sign in" step that links OpenAI's Terms of Use and Usage Policies. Those are the two texts a user most needs to understand in their own language before continuing. The same applies to "Cancel" there, and to one alarm status line from ef38869 ("Saved, but the band hasn't taken it yet…").

New guard test/ui_text_literals_translated_test.dart: it reads every literal passed to uiText, localizedText or presentationText under lib/. Each one must translate in at least one of de/ru/th, the complete catalogues, so a word that is legitimately the same in one of them still passes. On main it lists exactly these 23 call sites.

Testing

  • The guard fails on main (23 call sites) and passes with the change.
  • Every test file that mentions the coach, the alarm or ChatGPT passes (1,722 tests), along with the language coverage tests, copy_jargon_guard_test and the screen sweep.
  • app_state_pairing_confirmation_test failed once in a large parallel run and passes alone, on this branch and on main. It's unrelated.
  • flutter gen-l10n and flutter analyze are clean.

I'm not a native speaker. The data-sharing and terms texts are the ones most worth a native read.

Risks and rollback

Copy and lookup only. Revert the commit to roll back.

Checklist

  • Guard fails without the fix
  • No conflicts with the other open l10n PRs
  • Analyze clean

🤖 Generated with Claude Code

Summary by Sourcery

Translate previously untranslated ChatGPT sign-in and alarm status text across all supported languages and prevent similar omissions.

Bug Fixes:

  • Translate the ChatGPT sign-in flow, including its data-sharing notice and OpenAI terms step, instead of displaying English in every language.
  • Translate the alarm status shown when a saved alarm has not yet been received by the band.

Enhancements:

  • Add localized lookup mappings for the new ChatGPT and alarm strings while reusing the existing Cancel translation.

Tests:

  • Add a guard that scans translation helper call sites and fails when literal UI text has no catalogue translation.

Summary by CodeRabbit

  • Localization
    • Added translated messaging for alarm synchronization status and ChatGPT plan connection, sign-in, consent, usage, privacy, terms, and sign-out across multiple languages.
    • Added and updated localized descriptions of RMSSD, respiratory-rate, and within-night HRV stability methods, including relevant calculation details and limitations.

uvtqt and others added 2 commits November 15, 2026 12:16
…hod text, which every language showed in English since Oct 2

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…howed English in every language

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 English and translated catalogue entries for the alarm status and ChatGPT sign-in flow.

  • lib/l10n/app_de.arb L8-29
  • lib/l10n/app_en.arb L35-122
  • lib/l10n/app_es.arb L8-29
  • lib/l10n/app_fr.arb L8-29
  • lib/l10n/app_hi.arb L8-29
  • lib/l10n/app_ru.arb L8-29
  • lib/l10n/app_th.arb L23-44
  • lib/l10n/app_zh.arb L8-29

Implementation

Map the affected English literals to their catalogue entries, reusing the existing Cancel translation.

  • lib/l10n/display_text.dart L131-175

Tests

Add a guard that scans translation-helper calls and fails when their literals remain untranslated in German, Russian, and Thai.

  • test/ui_text_literals_translated_test.dart L1-61

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 →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 21 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 50b011ac-136b-4e64-b284-bd6c074dc76a
Commits

Reviewing files that changed from the base of the PR and between aef9d4d and 3271d48.

Files ignored due to path filters: 1

  • test/ui_text_literals_translated_test.dart is excluded by !test/**
Files selected for processing: 9

  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_hi.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_th.arb
  • lib/l10n/app_zh.arb
  • lib/l10n/display_text.dart

No actionable comments were generated in the recent review.

Walkthrough

Adds localized alarm-sync and ChatGPT subscription text in eight languages. Updates the localized descriptions of RMSSD, respiratory-rate estimation, and HRV stability methods.

Changes: Localized UI and method descriptions

Layer / File(s) Summary
Alarm and ChatGPT subscription strings
lib/l10n/display_text.dart, lib/l10n/app_*.arb
Adds localized alarm status and ChatGPT subscription text, including sign-in, consent, privacy, terms, and usage messages.
Health-method descriptions
lib/l10n/display_text.dart, lib/l10n/app_*.arb
Updates localized descriptions for RMSSD, respiratory-rate estimation, and HRV stability, including calculation details and stated limits.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: tahir101981-creator, abdulsaheel, mikenrafter

Merge Risk: Minimal · previous review aef9d

This change adds translations for the ChatGPT sign-in flow, an alarm status line, and three health-method descriptions. It carries minimal merge risk. Native-language review of the translated copy is still advisable.

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 the main change: localizing the ChatGPT sign-in flow and an alarm status line that displayed in English in every language. The raw summary and PR objectives confirm this, since the new…
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 the main change: localizing the ChatGPT sign-in flow and an alarm status line that displayed in English in every language. The raw summary and PR objectives confirm this, since the new entries cover the sign-in flow strings and the alarm sync status, added across all eight ARB files. The title is specific and does not hide the primary change.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • 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

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: 12c9ec50-6bba-4858-88dd-e927c7d1e3ed
Commits

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

Files ignored due to path filters: 2

  • test/metric_spec_copy_translated_test.dart is excluded by !test/**
  • test/ui_text_literals_translated_test.dart is excluded by !test/**
Files selected for processing: 9

  • lib/l10n/app_de.arb
  • lib/l10n/app_en.arb
  • lib/l10n/app_es.arb
  • lib/l10n/app_fr.arb
  • lib/l10n/app_hi.arb
  • lib/l10n/app_ru.arb
  • lib/l10n/app_th.arb
  • lib/l10n/app_zh.arb
  • lib/l10n/display_text.dart

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 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 3 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="test/ui_text_literals_translated_test.dart" line_range="47" />
<code_context>
+        ].join().replaceAll(r"\'", "'").replaceAll(r'\"', '"');
+        // Interpolated text can't be looked up verbatim; it is translated
+        // through its own message, not through this map.
+        if (text.contains(r'$') || text.trim().isEmpty) continue;
+        checked++;
+        String tr(AppLocalizations l) => m.group(1) == 'presentationText'
</code_context>
<issue_to_address>
**Sign-in errors remain English**

When a sign-in attempt fails with a ChatGptException, when ChatGPT sign-in fails, `_signInChatGpt` stores `ChatGptException.message` directly in `_msg`, and `coachPresentationText` returns unrecognized messages unchanged. Browser, timeout, and OAuth errors therefore remain English for users in other languages despite the claim to translate the sign-in flow.

Localize the user-facing ChatGPT sign-in errors, for example by using localized error keys at the presentation boundary.
</issue_to_address>

### Comment 2
<location path="lib/l10n/display_text.dart" line_range="132" />
<code_context>
     "Threshold" => l.activityZonesNameThreshold,
     "Max effort" => l.activityZonesNameMaxEffort,
+    "Saved, but the band hasn't taken it yet — it's sent again on the next sync" =>
+      l.alarmSavedNotOnBand,
+    "Using ChatGPT plan" =>
+      l.coachChatgptUsingPlanShort,
</code_context>
<issue_to_address>
**Old-language status remains visible**

When the app locale changes after a coach status is stored or while an alarm write is pending, `_msg` stores already-localized coach status text, and `notOnBand` is captured before the alarm write awaits. After a locale change, `coachPresentationText` cannot map the old translated string back to the new locale, while the alarm handler displays its captured string directly, so the user sees the status in the previous language.

Keep canonical English status text in state and localize it at render or failure-display time using the current locale.

Also at `lib/l10n/display_text.dart:136`, `lib/l10n/display_text.dart:139`, `lib/l10n/display_text.dart:141`.
</issue_to_address>

### Comment 3
<location path="test/ui_text_literals_translated_test.dart" line_range="21" />
<code_context>
+import 'package:openstrap_edge/l10n/presentation_text.dart';
+
+final _call = RegExp(
+  r"""\b(uiText|localizedText|presentationText)\(\s*[\w.?!]+\s*,\s*((?:'(?:[^'\\]|\\.)*'\s*|"(?:[^"\\]|\\.)*"\s*)+)\)""",
+);
+final _piece =
</code_context>
<issue_to_address>
**Untranslated copy escapes the guard**

When a translation-helper call uses a nested expression such as `AppLocalizations.of(c)` for its first argument, `_call` accepts only `[�w.?!]+` as its first argument, so it omits the call and the test passes without checking its literal; untranslated English copy can reach users in other languages.

Update the call matcher to handle nested expressions in the first argument so it checks these literals.

Also at `test/ui_text_literals_translated_test.dart:22`.
</issue_to_address>

Sourcery assessment

Approval pending. 3 findings to address first.

Blocking findings: test/ui_text_literals_translated_test.dart:47, lib/l10n/display_text.dart:132, test/ui_text_literals_translated_test.dart:21


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

Comment thread lib/l10n/display_text.dart Resolved
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: #725's commit landed on this branch by mistake. It's reverted here rather than force-pushed, so the net diff is only the ChatGPT sign-in and alarm fix (squash-merge recommended).

…calizations.of(c)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@abdulsaheel
abdulsaheel merged commit 6f62ad6 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