Skip to content

#886 Localisation: Home, Add Project and worktree text - #953

Closed
ivanfenenko wants to merge 1 commit into
feature/886-l10n-connectionfrom
feature/886-l10n-home
Closed

ivanfenenko wants to merge 1 commit into
feature/886-l10n-connectionfrom
feature/886-l10n-home

Conversation

@ivanfenenko

@ivanfenenko ivanfenenko commented Nov 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Stage 2, slice 2 of 6 for #886 (Localisation): Home, Add Project and the New worktree form now take their text from the string files on both platforms.

This is part of an unmerged stack: #933 → #952 → this pull request (base feature/886-l10n-connection). Nothing merges until all of stage 2 is done; it is retargeted as #933 and #952 merge.

  • Scope: the Home top bar, servers sheet ("Using now", "Switch to", "Manage in Settings"), New session and Run in sheets, scope picker ("All", "All projects", project, worktree and running counts, Show all / Show fewer, Edit / Done, reorder note), session actions and their dialogs, empty, loading and "Unable to connect" states, Home snackbars, the Add Project suggestion sheet and folder browser, and the New worktree form and row (shared with Session Chat's Move sheet).

  • Keys: 123 new keys with matching names under home.*, add_project.*, worktree.* and common.* (iOS home.new_session ⇔ Android home_new_session). Reused common.cancel, common.remove, common.loading_sessions, common.checking_server, servers.title, servers.add, top_bar.back and connection.error.unreachable.

  • Counts use plurals: projects, worktrees, "All N worktrees", "N running", "Show all N" and folders. Placeholders are positional, and nothing translatable is concatenated. "On Home · N folders" is a single key with the count as an argument.

  • English is unchanged. Two strings already differed between the platforms and still do, under one key: the fork result message and its stay button ("“X” is ready." / "Stay here" on Android, "Forked as “X”." / "Stay" on iOS).

  • Android Screen Models expose UiText and never call getString. This covers:

    • the worktree form state and NewWorktreeAvailability
    • the Add Project sheet model
    • probe and create errors, and the servers chrome title
    • session-action errors
    • Home snackbars: a new HomeSnackbar, resolved by the screen

    SessionListHomeChrome resolves picker and dock text through a UiTextLookup that the screen passes in.

  • iOS state carries OpenCodeText:

    • the worktree form, the Add Project sheet, the servers chrome title and dialog errors
    • HomeProjectCopy and the snackbars resolve from the catalog
    • .unlocalized is gone from every file in scope, except one case listed under Risks.
  • Server content stays verbatim: project, session, branch, folder and profile names, and server error text. It is passed as arguments and never looked up.

  • One additive design-system change: Android SessionListFilterTab gains pickerTitleOverride, which iOS already has, so Home can pass a localised "All projects". There is no visual change.

Checks

  • node scripts/check-string-keys.mjs: pass, 236 shared keys (237 Android names including the allowlisted app_name).

  • node scripts/check-hardcoded-text.mjs: total 928 → 778.

    • Android ui/main/* and ui/worktree/*: zero findings.
    • iOS UI/Main/* and UI/Worktree/*: one finding left, the relative-time caption (see Risks).
  • Android ./gradlew :app:assembleDebug and :app:compileDebugAndroidTestKotlin: pass.

  • Android unit tests: 522 run, 0 failed. They cover ui.main.*, ui.worktree.*, domain.home.*, domain.worktree.*, ui.text.*, SessionListFilterTest and SessionChatViewModelTest, including the new HomeTextTest.

  • iOS build (Debug, iPhone 17 simulator) and build-for-testing: pass, with no type-check warnings above 300 ms in the final incremental build.

  • iOS tests (-only-testing, serial): 163 tests in 7 suites ran. Passing suites:

    • HomeTextTests (new)
    • ProjectListHomeViewModelTests
    • SessionListHomeChromeTests
    • OpenCodeTextTests
    • SessionListFilterTests
    • AddProjectSuggestionsOnHomeTests

    WorktreeCreateModelTests failed in one test, nameRulesInOrder, where the assertions compared to English string literals. Those assertions are fixed and compile, but were not re-run (see Risks).

  • gitleaks is not installed locally; the Secret Scan workflow covers it.

Evidence

Verified once for the whole stack.

Issue

#886. Stage 2, slice 2 of 6; the remaining feature areas follow as stacked pull requests.

Risks / Follow-ups

  • Not run in this slice, because verification happens once for the whole stack:
    • simulator, emulator and scenario-harness runs
    • pseudo-locale screenshots
    • Android instrumented tests (MainScreenTest)
    • the iOS rerun of WorktreeCreateModelTests, and the HomeProjectPickerTests and SessionMoveTests suites
  • Still English, owned by shared code outside this slice:
    • Relative time: the Add Project suggestion caption ("1d ago") comes from the shared RelativeTimeFormatting, so iOS keeps it as .unlocalized. It belongs with the date-formatting work.
    • Optimistic session title: "New Session" now lives in OptimisticSessionCreate's placeholder title, next to the domain's untitled-session fallback; both belong with Session Chat.
    • Domain errors: the probe message (userMessage()) and the worktree repository's errors (WorktreeCreateCopy.NOT_GIT, UNSUPPORTED, requestFailed) are shown verbatim inside the keyed "Couldn't create the worktree: …" message. The diagnostic loadError on Android is not shown in the UI.
    • Design-system components: live-updates accessibility labels (OpenCodeTopBar, OpenCodeConnectionStatusLabel), the dock's "New session" button and its "Show / Hide worktrees of …" labels, and the session-list scope-load texts. They belong to the components slice.
    • Session Chat's Move list: on Android it still uses the domain HomeWorktreeCopy.worktreeSubtitle ("main checkout"); on iOS it now resolves from the catalog.
  • Keys used on one platform only for now:
    • Android only: common.selected, home.error.load_projects, home.session_error.generic, add_project.error.add_failed, worktree.unknown_error. These are Android fallbacks; iOS uses the system error text.
    • iOS only: home.worktree_count, home.show_worktrees, home.hide_worktrees. Android builds these strings inside the dock component.
  • Wording to settle across platforms: the fork result message and its stay button differ between platforms under the same key.

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.
@ivanfenenko ivanfenenko mentioned this pull request Nov 3, 2026
14 tasks done
@ivanfenenko
ivanfenenko marked this pull request as ready for review November 3, 2026 15:59
@ivanfenenko ivanfenenko mentioned this pull request Nov 3, 2026
@ivanfenenko

Copy link
Copy Markdown
Collaborator Author

Superseded by #975, which combines the whole #886 localisation stack into one pull request against main. Review and merge happen there.

@ivanfenenko ivanfenenko closed this Nov 3, 2026

@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.169 · 1 pass(es) failed

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