Repository navigation
feat(i18n): translate text built in the shared module - #871
Conversation
The KMP shared module can't read Android resources, so its view models and errors built English that no translation reached. - UiText moves into shared (same package, so no imports change) and gains Key and Plural, which name catalog strings through a SharedString or SharedPlural entry. android-shared maps each entry to its generated resource once; a test checks every row against its key. - ApiResult.Error gets an optional text: what a screen shows for an error the app builds. message stays English for logs. errorText(fallback) and errorTextOrNull() prefer it, then the server's message, then the fallback. The update-required gate, the temporary-password refusal, the household PIN cancel and two History cursor errors set it; code that passes an error on now returns the same object. - PasswordChangeError replaces the password form's English strings, built from a result with of(result) as PasswordLoginFailure.of does. NotificationsError replaces the inbox notices. - Auth and profile text (password change, profile access limits, household PIN, server update) and load errors (Home, Calendar, box set, collections, For You, row pages, Watchlist/Favorites, History) now come from the catalog on phone and TV. - docs/i18n.md describes the pattern for the follow-up workstreams. English is unchanged; "At least 1 characters" becomes "At least 1 character" when a server allows one-character passwords. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…om the shared module The shared module built English for request statuses and messages, the Watch Party lobby and its errors, and the player's subtitle sync statuses and card, so that text stayed English in every language. These now name catalog strings. Request progress has a phase enum and request reasons a reason enum; mutation messages are a sealed RequestActionMessage and Watch Party failures a sealed WatchPartyError; the lobby's presence summary is a sealed type android-shared words. Phone and TV resolve the text where they show it. English is unchanged. Shared tests keep their English assertions through a test renderer that formats the generated English catalog. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A server reason ending in whitespace kept it inside the translated sentence; the English used to be trimmed. (Sol round 1, F1) Co-Authored-By: Claude Opus 5.5 <[email protected]>
The page resolved a cancel or removal message once and showed that text for four seconds, so an in-place language change left it in the old language. It now holds the message and resolves it where it shows. Found in the adversarial review. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…unts only
The catalog's pass 2 brought Apple's keys for the Choose a new password
screen with the same English. The shared strings now name those keys
(newRequired, temporaryRequired, temporaryIncorrect, lead, leadUnnamed and
the eight with matching names) and shell.error.temporaryPassword, instead of
Android copies. tooShort and requirement keep Apple's {count}-only form
(D56), so UiText.Plural now fills {count} and then only the args a caller
passes; a {count_text} slot takes count.toString() first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The shared module built English for quality, skip-interval, poster-size and language pickers, library filter values, person badges, box set captions, episode captions, trailer kinds, calendar badges, audiobook chapter labels, book format names, the Collections "Ungrouped" header and card overlay badge values. These now return UiText naming catalog keys, and phone and TV screens resolve them in composition. UiText gains three values the screen formats in the interface language: Number (its digits, ungrouped, D55), CalendarDate (replacing the twelve English month names) and LanguageName (replacing English names on the original-language badge). SharedPlural.countIndex places the count for keys that declare another placeholder before it. Pickers select by value or UiText equality instead of comparing label text. English is unchanged, apart from "1 years old" and "x of 1 titles" now using the singular. Unused English (QualityPresets.describe, SeekImportResult.describe, the overlay preview chip) is removed; overlay settings copy stays English because Android never shows it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Code review found that on a phone set to a language with no catalog yet,
the English strings got that language's formatting ("1,5 Mbps", a German
month name, German language names). Numbers, dates and language names now
follow the configured locale only when the app ships its language, and
otherwise format as the English the strings fall back to, so nothing
changes until a catalog ships (D25).
Also from review: dates use the locale's digits; a language tag with no
name keeps its spelling in pickers (badges still uppercase it); person
dates outside years 1-9999 show as written instead of crashing; the
trailer kind line uppercases as before; the phone decade chip and the TV
chapter header use the same digits as the shared labels.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
… catalog
Sol review: on a phone set to a language that has no catalog yet, the
English fallback strings still took that language's plural rules, digits
and direction. Arabic showed "٨ films", Russian rules picked "21 film",
and in a right-to-left device language every isolated argument reversed
English captions ("Pilot · S01E02").
Catalog text from the shared module now resolves with resources in the
catalog's own language when the device language doesn't ship, so plural
rules, digits, number and date formats and isolation follow English, as
before. Shipped languages and the debug pseudo-locales resolve as
configured. App-named resources are unchanged.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ontext Sol review round 2: the fallback was built with the deprecated Resources(AssetManager, …) constructor around the caller's own asset manager. On Android 14 that constructor applies its configuration to the shared manager, so the caller's resources would then pick English for unrelated framework and direction-qualified resources. The fallback now comes from createConfigurationContext on the application context, recorded when text is resolved with a context or in composition, so the caller's resources keep their configuration. Number and date formats, and direction, follow the shipped-language check directly, so they stay English for a language without a catalog even before a context is recorded. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ed commit) Requests, Watch Party and subtitle sync text from the shared module. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ted commit) Settings, filters, catalog presentation and overlay badge text from the shared module. SharedString, SharedPlural and their mapping rows keep both branches' entries; the workstream markers are dropped. 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 9 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. |
|
Visible change; evidence is missing. The Evidence section says
Suggested fix: publish the before-and-after captures and replace the placeholder with the Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
d52ecfd to
fab9b7e
Compare
49747d4 to
151b676
Compare
|
Subtitle-sync notices and statuses ( Suggested fix: publish those captures with the linked evidence page and include all affected device configurations. Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
fab9b7e to
f6f4543
Compare
5a1897e to
7d0dcf9
Compare
f6f4543 to
34ccbb5
Compare
7d0dcf9 to
5923b26
Compare
34ccbb5 to
1090678
Compare
5923b26 to
7118d26
Compare
1090678 to
fb4daee
Compare
Problem
Related issue: N/A (translation program, Android shared module)
Validation tasks: none for US English devices. On a regional English device (en-GB, en-ZA), person-page dates and bitrates follow that region; no recorded case names a regional device.
Stack: 4 of 7, stacked on #870.
Pairs with Silo-Server/silo-apple#1078, the bottom of the Apple stack; Apple has no separate PR for shared-module text.
The shared Kotlin module can't read Android resources, so the text it builds stayed English in every language on phone and TV:
Several pickers also chose a value by comparing label text.
Approach
UiTextmoves into the shared module, with cases that name catalog strings (SharedString,SharedPlural).android-sharedmaps each name to its generated resource once, and a test checks the mapping. Phone and TV resolve the text when they draw it.ApiResult.Error.text) next to their English log message.UiTextgains a number, a calendar date and a language name, which the screen formats in the interface language.Shared tests keep their English assertions through a helper that formats the generated English catalog. Most keys are Apple's and Roku's existing ones, widened to Android.
Validation
Evidence
Evidence: https://evidence.siloserver.org/r/silo-android/pr-871/
Surface and build: phone, tablet, foldable (folded and open) and Android TV. The Spanish, Arabic, German and Japanese captures come from a build of the top of this stack, so every screen is fully converted; the English before-and-after pairs come from this PR's own base and head.
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 digits helper ignored the English fallback for a device language without a catalog. The helper now arrives in feat(i18n): translate settings, playback, browse, account and shell screens #869, and feat(i18n): format dates, numbers and durations in the app language #872 removes it and applies the fallback, so the stack carries it from there.🤖 Generated with Claude Code
Note
Localize app text via shared
UiTextcatalog and add app-language settingUiTextmodel andSharedStringcatalog keys in the shared module, with Android resolvers that format resources, plurals, dates, numbers, and language names, and isolate name arguments in RTL layouts (SharedUiText.kt, UiText.kt)String?toUiText?and are resolved at display timeAppLanguageStoreandAppLocales(per-app locales on Android 13+, stored preference and context wrapping on earlier versions), with an in-app language picker in Settings andAccept-Languagesent from device metadataResolvedSection.title_key/title_args, and V2 problem messages translate through the newProblemTextlocalizer installed byServerTextSILO_TRANSLATIONS_TOKENsecretUiTextinstead ofString,SettingsIndexedDropdownRowselecting by index,PlayerMessage/DetailPartyMessagereplacing strings, removedRequestDisplayState.label, removedwatchPartyErrorMessage); out-of-tree consumers of these symbols will break. Server-bound text (Watch Party suggestions, party fallback titles) deliberately stays EnglishSettingsDropdownRowwrapperMacroscope summarized 1090678.