Repository navigation
feat(i18n): offer pseudo-locales in the debug App language picker - #870
Conversation
Android TV has no per-app language screen and its emulator image lists no pseudo-locales, so a TV en-XA or ar-XB check had no route. Debug builds already package both in their localeConfig; the phone and TV pickers now list them after the shipped languages. Picking one applies it on this device and saves nothing, and the reconciler keeps it as the user's own value. Release builds have no pseudo-locales, so their picker is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…age state Code review found the debug pick bypassed the store: on a profile with its own language the next check put that language back and kept the pseudo-locale as the value to restore for other profiles, and picking a language afterwards did the same. - The pick now applies under the store's lock and records a ledger with no baseline, so it stays as the user's own value. - The picker offers pseudo-locales only while the profile has no value of its own, and lists a stored pseudo tag once. - Choosing a language after a pseudo-locale restores the device's language for other profiles, not the pseudo-locale (new reconciler test; it fails on the previous rule). - The selected-row lookup no longer calls LocaleManager on every recomposition. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A debug en-XA pick, then a switch to a profile with its own language, kept en-XA as the value to restore. Picking a real language on that profile kept it too, so the next profile without a language got en-XA back. A pick now drops a pseudo-locale baseline as well as a pseudo-locale it replaces, and the next such profile follows the device. A pseudo-locale set in system settings still comes back after a profile override, as before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 10 minutes. View limit details
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
The debug App language picker adds en-XA/ar-XB and applies the selected pseudo-locale to the interface ( Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
Quick104
left a comment
There was a problem hiding this comment.
Adversarial review (gpt-6.1-sol, reviewed 49747d4)
One verified finding appears inline. All 28 existing AppLanguage/reconciler tests pass in an isolated JVM harness using the pinned source. A separate sequence through the production reconciler reproduces F1. Android device behavior was not exercised.
AI disclosure: Codex (gpt-6.1-sol), adversarial review requested by the PR's author.
14ef7ed to
ee06f32
Compare
49747d4 to
151b676
Compare
ee06f32 to
6f326df
Compare
7d0dcf9 to
5923b26
Compare
95ef457 to
c9a0989
Compare
5923b26 to
7118d26
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
| * The pseudo-locales the picker offers now: none while the profile has a | ||
| * value of its own, which would apply over them. | ||
| */ | ||
| fun offeredPseudoLocales(state: AppLanguageState): List<String> = if (state.choice == null) pseudoLocales else emptyList() |
There was a problem hiding this comment.
An unmatched stored language hides the active pseudo-locale
An unshipped stored language makes the phone picker display Match device and the TV picker display a blank value, hiding the active pseudo-locale. Include the applied pseudo-locale in offeredPseudoLocales when the stored choice does not resolve to a shipped language.
Prompt for LLM
File android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/AppLanguageStore.kt, line 126:
An unmatched stored language hides the active pseudo-locale
A stored language that this build does not ship suppresses the active pseudo-locale even though `reconcile` cannot apply that stored value as an override. The phone picker then displays Match device and the TV picker displays a blank value, preventing users from seeing or reselecting the actual pseudo-locale; include the applied pseudo-locale in the options when the stored choice does not resolve to a shipped language.
Talk to Kody by mentioning @kody
Was this suggestion helpful? React with 👍 or 👎 to help Kody learn from this interaction.
Problem
Related issue: N/A (translation program)
Validation tasks: none (debug builds only)
Stack: 3 of 7, stacked on #869.
Pairs with Silo-Server/silo-apple#1078, the bottom of the Apple stack; Apple has no separate PR for the debug pseudo-locale picker.
Checking that text is translatable needs the en-XA and ar-XB pseudo-locales. Android TV has no system per-app language screen, and the shared emulator images have no pseudo-locales in system settings, so there was no way to switch those devices to en-XA.
Approach
Debug builds list en-XA and ar-XB after the shipped languages in the App language picker on phone and TV, while the profile has no language of its own. Picking one applies it on this device and saves nothing. Choosing a real language afterwards restores the device's own language for other profiles, not the pseudo-locale. Release builds package no pseudo-locales, so their picker is unchanged. After review, a real pick also drops a pseudo-locale kept as the restore value from an earlier profile switch.
Validation
cmd locale get-app-localesreported[en-XA].Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-870/
Surface and build: phone and Android TV debug builds. The pseudo-locale entries exist only in debug builds, so there is nothing to show in a translated release interface; tablet and foldable use the phone picker.
Risks
Checklist
AI Disclosure
scripts/sync-translations; T3 delegation to Codex for plan and adversarial reviewclaude-opus-5-5(code, extraction subagents, code-review finders);claude-sonnet-5-5(some code-review finders);gpt-6.1-sol(plan and adversarial review)gpt-6.1-solon its own branch; findings were fixed or answered there. The rebase ontomainwas checked against the pre-rebase tree file by file. Background review round 1 (Codexgpt-6.1-sol): F1, a pseudo-locale could survive as the restore value after a profile switch, fixed with a regression test.🤖 Generated with Claude Code
Note
Add per-app language selection with pseudo-locales to Android debug builds
AppLanguageStore,AppLocales, andAppLanguagelocale utilities that persist a profile- or device-scoped language choice, apply it on Android 13+ via framework per-app locales (with a local-store fallback on earlier versions), and reconcile profile choices with system changesAppLanguageSettingsSection,TvAppLanguageSettingsGroup), listing shipped languages plus pseudo-locales (XA/XB) in debug builds, and wiresui.app_languageinto the settings contract (revision 28)UiText/SettingsText/PlayerMessage/CompanionPairingTexttyped text models resolved at display time, including RTL name isolation and plural handlingProblemTextandServerTextlocalize section titles and API problem messages using the applied language, and requests now sendAccept-Languagefrom device metadatasync-translationsandcheck-translationsscripts plus a CI step that verifies generated translation output matches the pinned catalogHudChaptersPanein TvPlayerHud.kt and the compact runtime-minute expression inTvPlayerNextUpOverlayin TvPlayerScreen.kt contain invalid Kotlin interpolation as shown and will not compile as presented; also, texts sent to the server (Watch Party suggestion titles/subtitles, download fallback titles) intentionally remain EnglishMacroscope summarized 5923b26.