Skip to content

feat(l10n): add Thai language support - #652

Merged
abdulsaheel merged 5 commits into
OpenStrap:mainfrom
chayapats:feat/thai-translation
Nov 2, 2026
Merged

abdulsaheel merged 5 commits into
OpenStrap:mainfrom
chayapats:feat/thai-translation

Conversation

@chayapats

@chayapats chayapats commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Thai-speaking users currently fall back to English. Add ไทย to the language picker and provide Thai translations for all 3,340 messages in the current English ARB, including the four Stress Nerd Stats labels on main.

The Thai ARB preserves every key, metadata entry and ICU argument. Product names, technical abbreviations and dynamic external names retain their source values. Regression coverage checks message completeness, plural/select rendering, saved language selection on a short screen, and numbered OS notifications.

Validation with Flutter 3.41.6:

  • flutter gen-l10n — passed.
  • flutter analyze --no-pub — passed.
  • flutter test --no-pub --concurrency=1 for thai_l10n_test.dart, language_picker_sheet_test.dart, notification_number_bodies_l10n_test.dart, investigate_stress_index_test.dart and investigate_stress_load_test.dart — 23 passed.
  • Full suite with the translation on base 09009839 — 6,613 passed, 28 skipped, 1 failed on macOS. The failure is health_workout_export_delete_gate_test.dart:99 (“a failed delete does not write a duplicate on top of it”). That test assumes a non-Apple host, while HealthExporter.isApple is true on macOS. The same failure was reproduced on an untouched export of 09009839 without Thai support (10 passed, 1 failed). The current base is 797a9a4f; its stress tests are included in the targeted run above.

Summary by Sourcery

Add complete Thai language support and verify its integration across localization, language selection, and notification flows.

New Features:

  • Add Thai localization across the app and make Thai available in the language picker.

Enhancements:

  • Preserve Thai localization coverage for ICU arguments, dynamic values, and numbered notification content.

Tests:

  • Add regression coverage for Thai message completeness, plural and select rendering, language-picker persistence, and localized notifications.

Summary by CodeRabbit

  • New Features
    • Added Thai-language translations for app screens and messages, including onboarding, profiles, settings, health features, and error messages.
    • Added Thai to the language names shown in the app.

@sourcery-ai

sourcery-ai Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR introduces Thai as a selectable app locale by supplying a full 3,340-message ARB translation and registering it with the picker, with focused tests covering catalog parity, ICU behavior, notifications, selection, and persisted locale state. Targeted validation passes; the reported full-suite macOS failure reproduces on the unchanged base and is unrelated to Thai localization.

Sequence diagram for persisted Thai language selection

sequenceDiagram
    actor User
    participant Picker as Language picker
    participant Locale as Locale storage
    participant App as App localization

    User->>Picker: Select Thai
    Picker->>Locale: Persist locale th
    Picker->>App: Apply Thai locale
    App-->>User: Render Thai messages
    App->>Locale: Load saved locale
    Locale-->>App: Return th
Loading

Flow diagram for Thai locale selection and localization

flowchart LR
    User[User] --> Picker[Language picker]
    Picker --> Thai[Thai locale th]
    Thai --> ARB[app_th.arb]
    ARB --> Generated[Generated Flutter localization]
    Generated --> App[Localized app UI]
Loading

File-Level Changes

Change Details Files
Added a complete Thai localization catalog and registered Thai in the app’s language picker.
  • Added the Thai ARB with all English message keys, metadata, ICU placeholders, and translations, including Stress Nerd Stats labels.
  • Added the Thai display name to the supported language map.
  • Relied on generated localization support for the new locale.
lib/l10n/app_th.arb
lib/ui2/profile/profile.dart
Added regression coverage for Thai translation completeness, runtime formatting, picker selection, persistence, and notification localization.
  • Verified key and placeholder parity with English and non-empty Thai values.
  • Tested plural/select rendering, numeric interpolation, dynamic-name fallback, and translated notification bodies.
  • Tested Thai selection and persistence from the language picker on a constrained screen.
  • Included Thai in numbered notification body and title coverage.
test/thai_l10n_test.dart
test/notification_number_bodies_l10n_test.dart

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 Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files ignored due to path filters: 2
  • test/notification_number_bodies_l10n_test.dart is excluded by !test/**
  • test/thai_l10n_test.dart is excluded by !test/**
Run configuration
  • Source mode: Auto
  • Repository: OpenStrap/edge
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: 9873cfc
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: fa012004-bc3e-4604-a912-e5978754dcfb
Commits

Reviewing files that changed from the base of the PR and between cb2006b and bfd202e.

Files ignored due to path filters: 2
  • test/notification_number_bodies_l10n_test.dart is excluded by !test/**
  • test/thai_l10n_test.dart is excluded by !test/**

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
Walkthrough

The app adds a Thai localization catalog and adds Thai to the language-name table used by the language picker.

Changes: Thai localization

Layer / File(s) Summary
Add Thai translations
lib/l10n/app_th.arb
Adds Thai messages and ARB metadata across app features, including typed placeholders and plural/select forms.
Add the Thai language option
lib/ui2/profile/profile.dart
The language-name table maps th to ไทย.

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

Change: Feature

Possibly related issues

Possibly related PRs

Suggested labels: Review effort 5/5

Suggested reviewers: sourcery-ai

Merge Risk: Minimal · previous review f2318

The missing description does not affect generated translations; no material merge risk is identified.

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 "feat(l10n): add Thai language support" matches the main change. The PR adds Thai (th) to the language picker and adds a full Thai ARB localization catalog (app_th.arb) covering the app's UI…
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 "feat(l10n): add Thai language support" matches the main change. The PR adds Thai (th) to the language picker and adds a full Thai ARB localization catalog (app_th.arb) covering the app's UI strings. The title is short, specific, and states 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

@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 reviewed your changes and they look great!

Sourcery assessment

Approved.


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

Step calibration, raw-reading retention and compaction, the ChatGPT reset
warning and the CVHR no-comparison note were added to English after this
branch was cut, and the Thai key-parity test caught them.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Additional comments: 1
lib/l10n/app_th.arb-5018-5018: 1

5018-5018: Minor · Maintainability & Code Quality · Quick win

Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.

Restore the missing message description.

The English template defines @investigateCvhrNoComparisonYet, but the Thai entry has no matching metadata block. Add the template description so the Thai catalog preserves the promised metadata. (raw.githubusercontent.com)

Proposed fix
   "investigateCvhrNoComparisonYet": "ยังมีคืนก่อนหน้าไม่มากพอที่จะบอกได้ว่าการแกว่งของอัตราการเต้นหัวใจที่หน้านี้นับอยู่สูงกว่าปกติหรือไม่",
+  "@investigateCvhrNoComparisonYet": {
+    "description": "Sentence: too few older nights exist yet to compare the recent heart-rate cycling against"
+  },
   "investigateCvhrInsideUsual": "ในคืนล่าสุด ๆ รอบการเปลี่ยนแปลงอัตราการเต้นหัวใจที่การคัดกรองนี้นับได้ยังอยู่ในช่วงของ {n} คืนก่อนหน้า",

Review info
Run configuration
  • Source mode: Auto
  • Repository: OpenStrap/edge
  • Branch: main
  • File: .coderabbit.yaml
  • Commit: fba4a74
  • Layers: Repository YAML
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 23b92498-0ef3-41b0-837a-64b43f1e7357
Commits

Reviewing files that changed from the base of the PR and between 5466988 and f2318e5.

Files ignored due to path filters: 2
  • test/notification_number_bodies_l10n_test.dart is excluded by !test/**
  • test/thai_l10n_test.dart is excluded by !test/**
Files selected for processing: 1
  • lib/l10n/app_th.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.

@abdulsaheel

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@abdulsaheel

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@abdulsaheel

Copy link
Copy Markdown
Collaborator

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor
Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@abdulsaheel
abdulsaheel merged commit a9525d3 into OpenStrap:main Nov 2, 2026
4 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