Add English language support alongside Vietnamese #18

Merged
nezumi merged 1 commit from feat/i18n-english into dev 2026-11-22 02:46:07 +00:00
Owner

Adds English to the TV app, the phone remote and the release notes. Vietnamese stays the default everywhere.

TV app

  • New "Ngôn ngữ / Language" setting under Appearance, persisted with the other settings. It defaults to Vietnamese regardless of the system locale.
  • The language switches live. KaraRoot provides a localized Context, Configuration and Resources; stringResource reads LocalResources in Compose 1.13.
  • values-en/strings.xml translates every UI string. Brand names and author info are marked translatable="false".
  • The domain layer emits codes (NoticeCode, FailReason) instead of hardcoded Vietnamese text.
  • The home suggestions query is now "karaoke".
  • The phone dialog drops the server, network and self-test diagnostics. The error line and Retry button only appear when the server failed.
  • The settings button is pinned to the right edge of the top bar.

Protocol (backward compatible)

  • WebSocket toasts and HTTP errors carry a code (already_queued, wrong_room_code, rate_limited, unauthorized, search_failed, suggest_failed).
  • message / error keep the Vietnamese text, so older remotes still work. Documented in docs/protocol.md.

Remote web

  • Each phone has its own VI/EN toggle, stored in localStorage (kara.lang). It defaults to Vietnamese.
  • Toasts and errors are translated by code, falling back to the server text.

Release notes

  • release-prepare.sh writes a bilingual body with <!-- lang:vi --> / <!-- lang:en --> markers.
  • The Vietnamese lines come from an optional Vi: commit trailer and fall back to the English subject. Renovate commits collapse into "Cập nhật thư viện" in the Vietnamese section.
  • The update dialog shows only the chosen language's bullet lines. Bodies without markers from older releases are shown whole.

Testing

  • testDebugUnitTest passes: 54 tests, including new releaseNotesFor and settings-migration tests. lintDebug is clean.
  • pnpm typecheck and pnpm build pass for the remote.
  • On the Android TV emulator:
    • The language switches live and is kept after a restart.
    • The EN remote shows "Wrong room code".
    • The TV shows the "added by" toast in the current language.
    • A duplicate add sends code: already_queued.
    • The phone dialog and the settings button position look right.
Adds English to the TV app, the phone remote and the release notes. Vietnamese stays the default everywhere. ## TV app - New "Ngôn ngữ / Language" setting under Appearance, persisted with the other settings. It defaults to Vietnamese regardless of the system locale. - The language switches live. `KaraRoot` provides a localized `Context`, `Configuration` and `Resources`; `stringResource` reads `LocalResources` in Compose 1.13. - `values-en/strings.xml` translates every UI string. Brand names and author info are marked `translatable="false"`. - The domain layer emits codes (`NoticeCode`, `FailReason`) instead of hardcoded Vietnamese text. - The home suggestions query is now `"karaoke"`. - The phone dialog drops the server, network and self-test diagnostics. The error line and Retry button only appear when the server failed. - The settings button is pinned to the right edge of the top bar. ## Protocol (backward compatible) - WebSocket toasts and HTTP errors carry a `code` (`already_queued`, `wrong_room_code`, `rate_limited`, `unauthorized`, `search_failed`, `suggest_failed`). - `message` / `error` keep the Vietnamese text, so older remotes still work. Documented in `docs/protocol.md`. ## Remote web - Each phone has its own VI/EN toggle, stored in `localStorage` (`kara.lang`). It defaults to Vietnamese. - Toasts and errors are translated by `code`, falling back to the server text. ## Release notes - `release-prepare.sh` writes a bilingual body with `<!-- lang:vi -->` / `<!-- lang:en -->` markers. - The Vietnamese lines come from an optional `Vi:` commit trailer and fall back to the English subject. Renovate commits collapse into "Cập nhật thư viện" in the Vietnamese section. - The update dialog shows only the chosen language's bullet lines. Bodies without markers from older releases are shown whole. ## Testing - `testDebugUnitTest` passes: 54 tests, including new `releaseNotesFor` and settings-migration tests. `lintDebug` is clean. - `pnpm typecheck` and `pnpm build` pass for the remote. - On the Android TV emulator: - The language switches live and is kept after a restart. - The EN remote shows "Wrong room code". - The TV shows the "added by" toast in the current language. - A duplicate add sends `code: already_queued`. - The phone dialog and the settings button position look right.
Add English language support alongside Vietnamese
All checks were successful
CI / build (pull_request) Successful in 1m58s
b7f1cf867b
- TV: in-app language setting (Vietnamese by default), applied live via a
  localized Configuration/Resources; values-en strings.
- Domain notices and server errors are coded; protocol toasts and HTTP
  errors carry a `code` with the Vietnamese `message` kept as fallback.
- Remote: per-phone VI/EN toggle stored in localStorage, translates by code.
- Release notes are bilingual (optional `Vi:` commit trailer); the update
  dialog shows the section for the chosen language, bullet lines only.
- Home suggestions query is now "karaoke".
- Phone dialog drops the network/self-test diagnostics (error + Retry only
  on failure); settings button moves to the right edge of the top bar.

Vi: Thêm tiếng Anh cho ứng dụng (mặc định tiếng Việt)
nezumi deleted branch feat/i18n-english 2026-11-22 02:46:08 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nezumi/kara-tv-app!18
No description provided.