You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
l10n(zh): translate the supplement catalogue, so 300 strings stop falling back to English - #722
Chinese had none of the 300 supplement* strings that were added on Oct 7 (cc9dc10). de, ru and th have them. In a Chinese 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.
chinese_coverage_test already 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_zh.arb already uses: 手环, 消耗 (strain), 恢复, 心率变异性 (HRV), 静息心率, 常规范围, 训练, 日志, 生命体征, 简报 (briefing), and 你. Units are written as words (千克, 公里, 千卡, 分钟), as the existing strings do. 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_zh.arb, and no existing line changed.
Testing
chinese_coverage_test: the stricter test fails on main (300 missing) and passes with this change. A new case pins two of the strings.
A script check: same 300 keys as English, and every string has exactly the same {placeholders}.
Complete the Chinese supplement catalogue and enforce full English-to-Chinese localization coverage.
Bug Fixes:
Add Chinese translations for the complete supplement catalogue, preventing 300 user-facing strings from falling back to English.
Enhancements:
Expand Chinese localization coverage to include supplement notifications, progress messages, coach confirmations, lab markers, accessibility descriptions, and metric explanations.
Tests:
Require Chinese localization coverage for every English string and add regression checks for representative supplement translations.
Summary by CodeRabbit
Localization
Added Chinese translations for device and status explanations, charts, metrics, coaching actions, health observations, workout and sleep guidance, notifications, and accessibility labels.
Added Chinese descriptions of measurement methods and limitations, including step counting, recovery scores, sleep and heart-rate calculations, and sensor data availability.
The existing firmware-lock message remains unchanged.
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!
test/chinese_coverage_test.dart is excluded by !test/**
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.
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 Chinese localization resource adds interface strings and explanations for device status, health and activity metrics, sleep, measurement methods, and coaching actions and errors.
Changes: Chinese localization
Layer / File(s)
Summary
Interface and measurement strings lib/l10n/app_zh.arb
Adds Chinese labels, accessibility text, health and activity descriptions, measurement-method explanations, sleep and device-status guidance, and coaching messages. Includes a step-counting explanation and error messages for unsupported or non-JSON responses.
OpenStrap/edge#705: Adds Chinese translations in the same localization file and updates translation-coverage tests. PR #722 translates the remaining supplement catalogue strings and updates the same coverage state.
Suggested reviewers:abdulsaheel, sourcery-ai
Merge Risk: Minimal · up to c0b16
Merge Risk:⚪ Minimal · up to c0b16
This adds Chinese translations for about 300 strings that previously fell back to English. The change is purely additive and easy to revert, so merge risk is minimal. A native-speaker review of translation quality would still be worthwhile.
Pre-merge checks: 3 · 1
Failed checks: 1 inconclusive
Check name
Status
Explanation
Resolution
Title check
The title states the main change: Chinese translations for the supplement catalogue, so 300 strings no longer fall back to English. The raw summary describes Chinese ARB additions for device, chart, c…
Confirm that the changeset adds the 300 supplement* strings to lib/l10n/app_zh.arb. The raw summary lists other topics (device status, coach actions, sleep guidance) and does not mention supplements. If the supplement strings are present, t…
Passed checks: 3 passed
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title states the main change: Chinese translations for the supplement catalogue, so 300 strings no longer fall back to English. The raw summary describes Chinese ARB additions for device, chart, coach, health, and measurement strings. It does not mention supplement strings, so the title does not match the changeset as summarized. The PR objectives do describe 300 supplement* strings added to app_zh.arb, which conflicts with the file-level summary. The summary covers the same ARB file, so the title is plausibly related, but the summary and objectives disagree on which strings were added.
Resolution
Confirm that the changeset adds the 300 supplement* strings to lib/l10n/app_zh.arb. The raw summary lists other topics (device status, coach actions, sleep guidance) and does not mention supplements. If the supplement strings are present, the title is accurate and no change is needed. If the file-level summary is correct, update the title to match the strings actually added.
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.
Reviewing files that changed from the base of the PR and between b8fbe00 and 8e9650d.
Files ignored due to path filters: 1
test/chinese_coverage_test.dart is excluded by !test/**
Files selected for processing: 1
lib/l10n/app_zh.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.
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
<locationpath="test/chinese_coverage_test.dart"line_range="29-30" />
<code_context>
});
+ test('the supplement catalogue reads in chinese', () {
+ expect(zh.supplementNeedNights(3), '还需要 3 个晚上');
+ expect(zh.supplementNeedDays(2), '再佩戴 2 天即可解锁');
+ expect(zh.supplementDidYouNapccbced, isNot(en.supplementDidYouNapccbced));
+ });
</code_context>
<issue_to_address>
**Placeholder values can be hard-coded**
When a getter is changed to ignore its argument and return the tested literal, `the supplement catalogue reads in chinese` still passes at lines 29–30 if either getter ignores its argument and returns the tested literal: each input matches the number in the expected string. Callers using other counts then get incorrect progress text.
Assert each getter's output for at least one additional count with a matching expected string.
</issue_to_address>
The reason will be displayed to describe this comment to others. Learn more.
🟡 Medium · Placeholder values can be hard-coded
When a getter is changed to ignore its argument and return the tested literal, the supplement catalogue reads in chinese still passes at lines 29–30 if either getter ignores its argument and returns the tested literal: each input matches the number in the expected string. Callers using other counts then get incorrect progress text.
Assert each getter's output for at least one additional count with a matching expected string.
Prompt for AI agents
In `test/chinese_coverage_test.dart` at lines 29-30:
**Placeholder values can be hard-coded**
When a getter is changed to ignore its argument and return the tested literal, `the supplement catalogue reads in chinese` still passes at lines 29–30 if either getter ignores its argument and returns the tested literal: each input matches the number in the expected string. Callers using other counts then get incorrect progress text.
Assert each getter's output for at least one additional count with a matching expected string.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Chinese had none of the 300
supplement*strings that were added on Oct 7 (cc9dc10). de, ru and th have them. In a Chinese 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.chinese_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_zh.arbalready uses: 手环, 消耗 (strain), 恢复, 心率变异性 (HRV), 静息心率, 常规范围, 训练, 日志, 生命体征, 简报 (briefing), and 你. Units are written as words (千克, 公里, 千卡, 分钟), as the existing strings do. 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_zh.arb, and no existing line changed.Testing
chinese_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'm not a native speaker. A quick read by someone who is would help, especially the longer metric explanations.
Risks and rollback
Strings only, no code paths. Revert the commit to roll back.
Checklist
Spanish is #720 and French is #721; Hindi follows separately.
🤖 Generated with Claude Code
Summary by Sourcery
Complete the Chinese supplement catalogue and enforce full English-to-Chinese localization coverage.
Bug Fixes:
Enhancements:
Tests:
Summary by CodeRabbit