Skip to content

feat(i18n): offer pseudo-locales in the debug App language picker - #870

Merged
Quick104 merged 3 commits into
mainfrom
i18n/android-pr3-debug-pseudolocales
Nov 10, 2026
Merged

Quick104 merged 3 commits into
mainfrom
i18n/android-pr3-debug-pseudolocales

Conversation

@Quick104

@Quick104 Quick104 commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Unit tests (6,929) pass, including a reconciler test that fails on the earlier rule; both apps build.
  • Phone and TV debug builds list the pseudo-locales in the picker. Picking en-XA accented the interface in place; on TV, cmd locale get-app-locales reported [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

  • None for release builds: the entries come from a debug-only list.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: T3 Code through the Claude Code harness
  • Tool(s): Claude Code, GitHub CLI, Gradle, Android SDK, aapt2, T3 device tools, silo-translations scripts/sync-translations; T3 delegation to Codex for plan and adversarial review
  • Model(s): claude-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)
  • Involvement: Fully AI-generated, human-directed; a maintainer reviews before merge
  • Adversarial review: Each part of this stack had a high-effort code review by Claude subagents and an adversarial round by Codex gpt-6.1-sol on its own branch; findings were fixed or answered there. The rebase onto main was checked against the pre-rebase tree file by file. Background review round 1 (Codex gpt-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

  • Adds AppLanguageStore, AppLocales, and AppLanguage locale 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 changes
  • Adds an app-language picker to Settings on both phone and TV (AppLanguageSettingsSection, TvAppLanguageSettingsGroup), listing shipped languages plus pseudo-locales (XA/XB) in debug builds, and wires ui.app_language into the settings contract (revision 28)
  • Migrates nearly all phone and TV UI text — screens, view-model errors, player HUD, notifications, downloads, settings, pairing, and cast — from hard-coded English strings to shared string resources via new UiText/SettingsText/PlayerMessage/CompanionPairingText typed text models resolved at display time, including RTL name isolation and plural handling
  • Server-side text gains translation: ProblemText and ServerText localize section titles and API problem messages using the applied language, and requests now send Accept-Language from device metadata
  • Adds sync-translations and check-translations scripts plus a CI step that verifies generated translation output matches the pinned catalog
  • Risk: HudChaptersPane in TvPlayerHud.kt and the compact runtime-minute expression in TvPlayerNextUpOverlay in 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 English

Macroscope summarized 5923b26.

Quick104 and others added 3 commits November 9, 2026 10:16
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]>
@coderabbitai

coderabbitai Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

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.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 77 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9ec7f853-ca91-42d4-853f-b2f2e2826d73
Commits

Reviewing files that changed from the base of the PR and between 59f15e5 and 7118d26.

Files selected for processing: 7

  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/AppLanguageOptions.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/AppLanguageStore.kt
  • android-shared/src/androidMain/kotlin/org/siloserver/silo/common/i18n/AppLocales.kt
  • androidApp/src/androidMain/kotlin/org/siloserver/silo/android/ui/screens/settings/AppLanguageSettings.kt
  • androidTvApp/src/androidMain/kotlin/org/siloserver/silo/tv/ui/screens/settings/TvSettingsScreen.kt
  • shared/src/commonMain/kotlin/org/siloserver/silo/model/settings/AppLanguage.kt
  • shared/src/commonTest/kotlin/org/siloserver/silo/model/settings/AppLanguageTest.kt
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 9, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T02:07:45.193043Z 7118d26 New commits
🔒 Security Review ✅ Completed 2026-11-10T02:08:40.796364Z 7118d26 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@macroscopeapp

macroscopeapp Bot commented Nov 9, 2026

Copy link
Copy Markdown

The debug App language picker adds en-XA/ar-XB and applies the selected pseudo-locale to the interface (android-shared/.../AppLanguageStore.kt, android-shared/.../AppLocales.kt, androidApp/.../AppLanguageSettings.kt, and androidTvApp/.../TvSettingsScreen.kt). The evidence link is provided for phone and TV; the page should also show before-and-after screenshots on an Android tablet and a foldable both folded and open, which the shared phone picker reaches. Suggested fix: add those captures to the evidence page.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@silo-triage silo-triage Bot added enhancement New feature or request priority: P2 Limited scope, workaround exists, or polish stacked Stacked on another open PR or branch labels Nov 9, 2026

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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.

@Quick104
Quick104 force-pushed the i18n/android-pr2-extraction branch from 14ef7ed to ee06f32 Compare November 9, 2026 19:46
@Quick104
Quick104 force-pushed the i18n/android-pr3-debug-pseudolocales branch from 49747d4 to 151b676 Compare November 9, 2026 19:46
@Quick104
Quick104 force-pushed the i18n/android-pr2-extraction branch from ee06f32 to 6f326df Compare November 9, 2026 20:14
@Quick104
Quick104 force-pushed the i18n/android-pr3-debug-pseudolocales branch 3 times, most recently from 7d0dcf9 to 5923b26 Compare November 10, 2026 01:17
@Quick104
Quick104 force-pushed the i18n/android-pr2-extraction branch 2 times, most recently from 95ef457 to c9a0989 Compare November 10, 2026 01:42
@silo-triage silo-triage Bot added size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. and removed size/M 50–199 added + deleted lines (all files); change volume, not priority. labels Nov 10, 2026
Base automatically changed from i18n/android-pr2-extraction to main November 10, 2026 02:06
@Quick104
Quick104 force-pushed the i18n/android-pr3-debug-pseudolocales branch from 5923b26 to 7118d26 Compare November 10, 2026 02:06
@silo-triage silo-triage Bot added size/M 50–199 added + deleted lines (all files); change volume, not priority. and removed size/XXXL 3000+ added + deleted lines (all files); change volume, not priority. labels Nov 10, 2026
@silo-kody

silo-kody Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104
Quick104 merged commit 6af97fe into main Nov 10, 2026
9 checks passed
@Quick104
Quick104 deleted the i18n/android-pr3-debug-pseudolocales branch November 10, 2026 02:07
* 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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

kody code-review Bug medium

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.

​

​

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority. stacked Stacked on another open PR or branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant