Skip to content

#886 Localisation - #975

Merged
ivanfenenko merged 18 commits into
mainfrom
feature/886-localisation
Nov 3, 2026
Merged

ivanfenenko merged 18 commits into
mainfrom
feature/886-localisation

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Localisation for both apps, as one pull request: the #886 foundation and every extraction slice from the stacked pull requests, merged with current main. English text now comes from Localizable.xcstrings (iOS) and res/values/strings.xml (Android) with matching keys, server and session content stays verbatim, and CI checks key parity and counts hardcoded text.

This replaces the 11 stacked pull requests so the work can be reviewed and merged at once. The branch is a merge of feature/886-l10n-wording (top of the stack, which contains every slice below it) into current main, plus merge commits from main that resolve the conflicts and key the text main added since.

Areas covered

About 1,094 keys match across the platforms. 11 hardcoded-text findings remain, down from about 1,050.

Checks

Run on the combined branch at its head (merge of the stack with current main):

  • node scripts/check-string-keys.mjs: pass, 1,094 shared keys (1,095 Android names including the allowlisted app_name).
  • node scripts/check-hardcoded-text.mjs: 11 findings, warning only (the same 11 as the top of the stack; main's new text added none after keying). They are listed under Risks.
  • Android ./gradlew :app:testDebugUnitTest :app:assembleDebug: pass. 3,217 unit tests, 0 failures.
  • Android ktlintMainSourceSetCheck / ktlintTestSourceSetCheck: nothing new in the lines this merge changed. The files still carry existing violations from main (CI soft-fails ktlint).
  • iOS build-for-testing (Debug, iPhone 17 simulator): pass.
  • iOS OpenCode MobileTests, full target: 3,161 tests in 305 suites pass.
  • gitleaks git --pre-commit --staged: no leaks.
  • Not run: Android instrumented tests (connectedDebugAndroidTest), iOS UI tests, Android lintDebug (CI soft-fails it on existing debt), xcodebuild analyze.

Slices #954 through #960 were written without compiling, with builds and tests deferred to the whole stack. The issue reports the top of the stack building with the unit suites passing; the runs above are on the merged branch. The merge with main needed two compile fixes on iOS and one on Android, all in the background work panel from #971.

Evidence

Screenshots already posted on the stacked pull requests, all against scenario-harness fixture data or a fresh install. They still apply; the screens they show are not touched by later slices beyond keying text whose English is unchanged.

Not captured for this pull request. The other slices (#953 through #960) deferred their screenshots to "once for the whole stack", and that pass never happened, so there is no on-device evidence for Home, Files, Terminal, Session Chat and its sheets, Settings, Changes, the timeline, or the components. The unit tests compare resolved English for those areas, and the catalog falls back to the same English, but nothing has looked at them on a device. That includes the background work panel's Running / Done tabs keyed in this merge. Before merging, a harness-backed English smoke pass on both platforms over the main screens would cover this (see Risks), plus the pseudo-locale pass the issue already lists.

Issue

#886. This finishes stage 1 (foundation) and most of stage 2 (extraction). The issue stays open: the last 11 check findings, text the check cannot detect, --strict, the pseudo-locale pass, the translation service and the first language are still to do.

Supersedes, without closing or retargeting them:

#958 (Changes source fallback) has since merged into main and is merged into this branch, with its hint text keyed.

Risks / Follow-ups

  • No on-device check of most screens (see Evidence). English is meant to be unchanged; a wrong key or a Text("\(…)") looked up as a key would show on device and not in unit tests. Suggested before merge: a harness-backed English pass over Home, Session Chat (timeline, sheets, background work Running / Done), Files, Terminal, Changes and Settings on both platforms.
  • Wording that changed on purpose (from #886 Localisation: one wording on both platforms, count grammar #960 and #886 Localisation: component and shared text #968): one wording per key across platforms, including the App Lock description (one string for Face ID / Touch ID and Android face / fingerprint / PIN, the choice most worth a second look), "Couldn't load" with a straight apostrophe on iOS, Android "Loading session" for a skeleton row, and Android "this device" in dictation details. Count grammar now uses plurals for "Last 1 minute", "1 redacted line", show / hide counts, and the worktree name limit. The code review on this pull request also found these English changes, not named before:
    • Android Files: "File options" → "More options"; "Opening file" / "Opening image" → "Loading file" / "Loading image".
    • Android Feedback: "No log lines in this window." → "Nothing was logged in the last N minutes."
    • Android App Lock unavailable: "Set a screen lock on this device to use App Lock" → "Set a device passcode to use App Lock" ("passcode" is the iOS word).
    • iOS Files: "Check the connection and try again." → "Check the connection to the server and try again."
    • Android top bar: a subtitle shown alone is no longer capped at 220dp (layout, from the foundation's pseudo-locale fixes).
  • Open items carried over from the stacked pull requests:
    • 11 hardcoded-text findings, mostly iOS Session Chat .unlocalized: the attachment drop summary, the composer model notice, the side-question notice, the rename error, the Move to worktree menu, sheet and rows, and the composer "Default" variant chip.
    • Text the check cannot detect: Android "New Session" placeholder title and "Compacting…" status, Android "main checkout" in the Move list, "The server responded with N.", and about ten accessibility phrase builders. The child-session and task row state words ("running", "waiting for input", "done") read by VoiceOver / TalkBack are still English on both platforms; that includes the new OpenCodeTaskRow from main.
    • Plurals that keep the old English one form: "N sessions", "N more running", "N agents", "N matches / files / lines", relative-time units. Multi-argument counts ("N of M connected", "%1$d saved · %2$s active") are plain strings.
    • Keys present on both platforms but used on one, because the screens or accessibility conventions differ; Android lint may report the iOS-only ones as unused resources.
    • Domain text still English: the credential-store save error, the diagnostic logs share subject, the theme load error, durations and fork titles.
    • Dates and numbers are pinned to English formats: Android Locale.US "MMM d" and "h:mm a" (relative time, timeline, composer, session adapter) and Session Context numbers and costs; iOS en_US_POSIX in relative time and Session Context. Relative time is built from plurals rather than a platform relative-date formatter. Issue Localisation #886 asks for platform formatters.
    • tool.count.named ("%d %s", such as "3 reads") has no plural form.
    • Design-system limits: onboarding row details and the iOS top bar title truncate under long text; in right-to-left the back arrows outside the top bar and the iOS http / https picker chevron do not mirror.
    • The automated review on #886 Localisation foundation: string catalog, UiText, CI checks #933 raised two single-pass, unconfirmed points worth a look: OpenCodeSectionHeader and OpenCodeTextInput resolve their text to String, so they may not follow a live language change.
  • Changed by this merge: on Android, SessionChatBackgroundWork.result no longer returns "Stopped" for a stopped call without a reason; the row text adds it. iOS keeps the fallback in result, resolved with String(localized:) like the rest of its row text.
  • Stale after a language change: iOS resolves several texts into String when computed (snackbars, background work rows, pill copy). They update on the next refresh, not instantly.
  • Merging this as a squash keeps one commit on main; a merge commit keeps the 16 slice commits.

🤖 Generated with Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Note

Medium Risk
Very wide user-facing and navigation serialization changes (UiText in saved nav state) increase regression risk for wording, plurals, and accessibility, though behavior is mostly unchanged English copy.

Overview
This PR lands the #886 localization foundation and extraction on Android (with matching iOS catalog work described in the PR): user-facing copy moves out of Kotlin into strings.xml / plurals, resolved in Compose via UiText (resource, plural, verbatim) and stringResource, while server/session content stays verbatim.

CI and Android tooling: A new String Checks workflow runs check-string-keys.mjs (Android/iOS key parity) and check-hardcoded-text.mjs (warning + step summary). Debug builds enable pseudo-locales; generateLocaleConfig exposes per-app language in system settings.

App-wide refactors: Navigation args (SessionToolGroup, etc.) serialize UiText for titles that must follow locale after restore. Domain helpers (relative time, session ladder sections, ChangeSource, errors, share subjects, theme load errors) return UiText instead of hard-coded English. Large UI areas (Changes, session list dock, activity cards, dictation, attachments, top bar**) use keyed strings and plurals; OpenCodeTopBar back control mirrors in RTL. Hardcoded copy objects (CleartextPolicy, HomeWorktreeCopy, WorktreeCreateCopy, sync chrome) are trimmed in favor of resources.

Eleven hardcoded-text findings and some English-only domain/accessibility strings remain; check-hardcoded-text is warning-only until extraction is complete.

Reviewed by Cursor Bugbot for commit 872bab3. Bugbot is set up for automated code reviews on this repo. Configure here.

ivanfenenko and others added 17 commits November 2, 2026 15:06
# Conflicts:
#	ios/OpenCode Mobile/OpenCode Mobile/UI/Playground/SessionChatPlaygroundView.swift
#	ios/OpenCode Mobile/OpenCode Mobile/UI/SessionChat/SessionChatView.swift
… bar subtitle

- Servers' Active badge and the top bar Back label come from strings.xml
  (servers_status_active, top_bar_back) with matching catalog keys.
- The top bar Back arrow flips in right-to-left layouts.
- The 220dp subtitle cap only applies when a status follows it, so a plain
  subtitle such as the profile count uses the full width, as on iOS.
- The Servers "Active" badge and the top bar's default Back label use the
  servers.status_active and top_bar.back catalog keys instead of English
  literals, so the Servers screen has no text missing from the catalog.
- The top bar Back arrow flips in right-to-left layouts.
Move the user-facing text in Connection setup, the pairing QR scanner,
Connection onboarding, App onboarding, the privacy cover and the app-root
loading state into strings.xml and Localizable.xcstrings with matching keys
(connection.*, onboarding.*, privacy_cover.*, common.*). English is unchanged.

- Android: the Connection setup Screen Model now exposes UiText (titles,
  primary action, pair-again text, cleartext warning, saved-address rows and
  error snackbars); the screen resolves it. Hosts stay verbatim.
- iOS: the Screen Model returns OpenCodeText for titles, actions and
  saved-address rows; snackbar errors come from the catalog.
- The "Connection isn't encrypted" text moves from the domain CleartextPolicy
  to the Connection setup UI on both platforms.
- Tests compare resolved English (new EnglishStrings lookup on Android) and
  cover the new UiText/OpenCodeText values.
Move the user-facing text of Home (top bar, servers sheet, New session and
Run in sheets, scope picker, session actions and dialogs, empty and error
states), Add Project (suggestion sheet and folder browser) and the New
worktree form into strings.xml and Localizable.xcstrings with matching keys
(home.*, add_project.*, worktree.*, common.*). English is unchanged.

- Android Screen Models expose UiText: worktree form state and availability,
  Add Project sheet model, Home probe/create errors, servers chrome title,
  session-action errors and Home snackbars (HomeSnackbar, resolved by the
  screen). SessionListHomeChrome resolves picker and dock text through a
  UiTextLookup. Project, branch, folder and server text stays verbatim.
- iOS state carries OpenCodeText (worktree form, Add Project sheet, servers
  chrome title, dialog errors); HomeProjectCopy and snackbars resolve from the
  catalog. All .unlocalized calls in scope are gone except the relative-time
  caption, which comes from the shared RelativeTimeFormatting.
- Counts use plurals (projects, worktrees, running, folders, Show all N);
  names are positional arguments, never concatenated.
- Android SessionListFilterTab gains pickerTitleOverride (as on iOS) so Home
  can pass a localised "All projects".
- Tests compare resolved English or the UiText/OpenCodeText itself; new
  HomeTextTest / HomeTextTests cover plurals and verbatim arguments.
Design-system components and the domain/shared code they read now take
their English from the string files on both platforms: session list,
dock and picker, live updates, top bar, composer, dictation card, activity
card and sheet, step rail, image gallery and viewer, attachments, and small
default labels. Relative times, session list section titles, share
subjects, theme errors and the new-session title are keyed too.

The hardcoded-text check now scans design-system components (galleries,
previews, sample declarations and animation labels excluded).
Merges feature/886-l10n-wording, the top of the #886 stack (#933, #952-#957,
#959, #969, #968, #960), into current main.

Conflicts came from the background work panel's Running / Done tabs (#971),
which landed on main after the stack was cut. Its new text is keyed on both
platforms: tab titles, both empty states, "Waiting for input", "Stopped",
the "N tools" plural and the filter tabs' "new" accessibility word.

- Android: the panel row text is UiText. The step title and the relative
  time already were after the stack; a stopped subagent's "Stopped" moved
  from the projected result into the row text, so no projection holds
  resolved app text.
- iOS: the step title resolves from TimelineText, and the task row's agent
  tag is verbatim content.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 872bab3. Configure here.

Merges main with #958 (Changes points to the other source when one is
empty). Its new text is keyed on both platforms: the "Git changes has N
changed files." / "The last turn changed N files." plurals, the "Show %s"
action, and one format that joins the empty detail and the hint, so
translators control the order. Android holds the hint as UiText; iOS as
OpenCodeText.

Also keys the session list's Recent hint ("Needs a glance"), which was
still a hard-coded constant on both platforms while its title was keyed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@github-actions github-actions 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.

Automated review: no finding that 2+ of 2 passes agreed on.

opencode pr-review · passes: muse-spark-1.3-contributor, glm-5.3-flash, deepseek-v4.1-flash · $0.110 · 1 pass(es) failed

@ivanfenenko
ivanfenenko merged commit 05d2248 into main Nov 3, 2026
@ivanfenenko
ivanfenenko deleted the feature/886-localisation branch November 3, 2026 17:13
ivanfenenko added a commit that referenced this pull request Nov 3, 2026
Conflicts came from #886 moving app text to string resources while this
branch added keyboard focus, right-click and new shortcuts on the same
lines. Kept both: main's localised labels with the branch's focus and
secondary-click modifiers.

Keyboard shortcut titles now follow main's resource model on both
platforms, extended to every Tier 2 shortcut: Android titles and group
labels are UiText resolved for the Keyboard Shortcuts Helper; iOS titles,
menu names and prompt-chord titles are LocalizedStringResource. New keys
under keyboard_shortcuts.* on both platforms; the single Sessions group
key is replaced by the Session, Prompt and Go groups.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.

1 participant