Repository navigation
#886 Localisation: Home, Add Project and worktree text - #953
Closed
ivanfenenko wants to merge 1 commit into
Closed
ivanfenenko wants to merge 1 commit into
ivanfenenko wants to merge 1 commit into
Conversation
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.
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.*andcommon.*(iOShome.new_session⇔ Androidhome_new_session). Reusedcommon.cancel,common.remove,common.loading_sessions,common.checking_server,servers.title,servers.add,top_bar.backandconnection.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
UiTextand never callgetString. This covers:NewWorktreeAvailabilityHomeSnackbar, resolved by the screenSessionListHomeChromeresolves picker and dock text through aUiTextLookupthat the screen passes in.iOS state carries
OpenCodeText:HomeProjectCopyand the snackbars resolve from the catalog.unlocalizedis 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
SessionListFilterTabgainspickerTitleOverride, 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 allowlistedapp_name).node scripts/check-hardcoded-text.mjs: total 928 → 778.ui/main/*andui/worktree/*: zero findings.UI/Main/*andUI/Worktree/*: one finding left, the relative-time caption (see Risks).Android
./gradlew :app:assembleDebugand:app:compileDebugAndroidTestKotlin: pass.Android unit tests: 522 run, 0 failed. They cover
ui.main.*,ui.worktree.*,domain.home.*,domain.worktree.*,ui.text.*,SessionListFilterTestandSessionChatViewModelTest, including the newHomeTextTest.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)ProjectListHomeViewModelTestsSessionListHomeChromeTestsOpenCodeTextTestsSessionListFilterTestsAddProjectSuggestionsOnHomeTestsWorktreeCreateModelTestsfailed 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).gitleaksis 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
MainScreenTest)WorktreeCreateModelTests, and theHomeProjectPickerTestsandSessionMoveTestssuitesRelativeTimeFormatting, so iOS keeps it as.unlocalized. It belongs with the date-formatting work.OptimisticSessionCreate's placeholder title, next to the domain's untitled-session fallback; both belong with Session Chat.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 diagnosticloadErroron Android is not shown in the UI.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.HomeWorktreeCopy.worktreeSubtitle("main checkout"); on iOS it now resolves from the catalog.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.home.worktree_count,home.show_worktrees,home.hide_worktrees. Android builds these strings inside the dock component.