Repository navigation
feat(mobile): localize app interface - #11446
brennanb2025 wants to merge 60 commits into
Conversation
|
Too many files changed for review (344 files, 100 file limit). Bypass the limit by tagging |
…18n-audit # Conflicts: # package.json
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis PR introduces a mobile i18n system built on i18next, adding locale catalogs for English, Spanish, Japanese, Korean, and Simplified Chinese under 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 10
Note
Due to the large number of review comments, Critical, Major severity comments were prioritized as inline comments.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
mobile/src/tasks/mobile-work-items.ts (1)
7-22: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winDo not use localized UI text as the SSH-remote error sentinel.
isGitHubWorkItemsSshRemoteRequiredErrordrives the GitHub-remote setup path, butt('m.oBMMuM8')will not match the canonical English error from the upstream provider on non-English locales. Match a stable error code/type instead; otherwise keep the canonical detection string and localize only when displaying it.mobile/app/h/[hostId]/session/[worktreeId].tsx (1)
3921-3925: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
errorToastis still hardcoded English.
labelis localized on line 3921, but the surrounding toast template isn't, so non-English users seeCouldn't run <label>. Route it through a key with the label as a parameter.🌐 Proposed fix
const label = command.label.trim() || t('m.sgQvHe0') void handleCreateTerminal(launch.agent, { ...launch.options, - errorToast: `Couldn't run ${label}` + errorToast: t('<quick_command_run_failed_key>', { value0: label }) })
🟡 Minor comments (21)
config/scripts/localize-mobile-strings.mjs-13-17 (1)
13-17: 🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick winTruncated hash keys can collide silently and overwrite catalog copy.
The key is only 40 bits of SHA-1, and
setCatalogValueblindly overwrites, so a collision between two distinct strings silently assigns one file's copy to the other's call site — invisible toverify-mobile-localization-catalog.mjs, which only checks key presence and placeholder parity. Add a collision guard when writing:🛡️ Proposed guard
for (const { candidate, translation } of replacements) { const key = keyForCandidate(candidate, translation.fallback) + const existing = key.split('.').reduce((node, part) => node?.[part], catalog) + if (typeof existing === 'string' && existing !== translation.fallback) { + throw new Error(`Key collision for ${key}: "${existing}" vs "${translation.fallback}"`) + } setCatalogValue(catalog, key, translation.fallback)Also applies to: 265-274
config/scripts/mobile-localization-candidate-rules.mjs-473-493 (1)
473-493: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winNegative operator allowlist conflates assignment with comparison in both binary-ancestor checks. Both helpers reject any
BinaryExpressionwhose operator isn't+,&&,||, or??; since TypeScript represents=,+=, and,as binary expressions, assignment right-hand sides are silently excluded from mobile localization candidates. Extract one shared predicate that matches only comparison/equality/bitwise/logical-assignment operators you actually want to exclude.
config/scripts/mobile-localization-candidate-rules.mjs#L473-L493: inisComparisonOperand, test the operator against an explicit comparison-token set instead of negating the display-operator list.config/scripts/mobile-localization-candidate-rules.mjs#L451-L471: inhasDisqualifyingBinaryAncestor, reuse that same predicate so assignment ancestors no longer disqualify candidates.mobile/src/i18n/mobile-i18n.ts-28-30 (1)
28-30: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winSelect the first supported preferred locale, not only the first device locale.
getLocales()returns the user’s preferred locales in preference order, butnormalizeMobileUiLocale()still maps unsupported tags such asfr-FRtoen, so a supported later locale likees-ESis skipped. Iterate through the locale list and select the first supported tag; only fall back to the default when none match.Source: MCP tools
mobile/src/i18n/locales/en.json-541-541 (1)
541-541: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winReplace HTML entities with literal characters.
React Native will render
'and&verbatim in these strings. Use'and&directly.Also applies to: 887-888, 894-894
mobile/src/source-control/MobileSourceControlPrChip.tsx-115-124 (1)
115-124: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize and pluralize the unresolved-comments suffix.
Line 117 constructs an English fragment and always uses “comments,” so accessibility labels become partially untranslated and read “1 unresolved comments.” Let a translation key own the wording and singular/plural choice, passing the count as an interpolation value.
mobile/src/transport/host-endpoint.ts-183-187 (1)
183-187: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize
validateHostnameerrors too.When
validateHostnamereturns an error, Lines 189-191 and 272-274 pass through its hardcoded English strings from Lines 298-327. Localize the shared validator, or translate structured error codes at both boundaries, so invalid-hostname failures respect the selected locale.mobile/src/transport/mobile-relay-rpc-streams.ts-66-67 (1)
66-67: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize the send-failure fallback as well.
The new catch fallback uses
t(), but the adjacentsendFramefailure still passes hardcoded'Connection interrupted'at Line 62. Use the same translation key there so both connection-failure paths follow the active locale.mobile/src/worktree/workspace-list-sections.ts-138-141 (1)
138-141: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep the localized fallback out of the grouping key.
byRepouses the translated fallback as an identity key, so a real repository with the same localized name can be merged with worktrees whose repository is missing. Use a stable sentinel for the map key and translate only the section title.mobile/src/session/mobile-session-route-helpers.ts-3-11 (1)
3-11: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winResolve module-level translation keys at the call sites.
t()returns the current translation instantly on module load here, so these constants record the initial locale instead of updating when the language changes.
mobile/src/session/mobile-session-route-helpers.ts#L5-L12: resolve labels when constructing status display values.mobile/src/session/mobile-tab-close-selection.ts#L5-L8: resolve labels when constructing the bulk-close action sheet.mobile/app/h/[hostId]/session/[worktreeId].tsx-5326-5333 (1)
5326-5333: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRename modal default value keeps the literal
'Terminal'.Every other fallback for a terminal title in this file uses
t('m.1ELofI0')(lines 4451, 5136, 5206), so this one prefills the rename field with English while the modal title and placeholder are localized.🌐 Proposed fix
- defaultValue={renameTarget?.title || 'Terminal'} + defaultValue={renameTarget?.title || t('m.1ELofI0')}mobile/app/h/[hostId]/index.tsx-871-873 (1)
871-873: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winUntranslated English leaks into this accessibility label.
The interpolated fragment
, ${activeFilterCount} activestays English regardless of locale, so the label reads e.g.Filtros, 2 activefor Spanish users. Move the whole active-count phrase into a translation key that takes the count as a parameter.🌐 Suggested shape
- accessibilityLabel={t('m.kz_Kdkw', { - value0: activeFilterCount > 0 ? `, ${activeFilterCount} active` : '' - })} + accessibilityLabel={ + activeFilterCount > 0 + ? t('<filters_with_active_count_key>', { value0: activeFilterCount }) + : t('<filters_key>') + }mobile/app/mobile-onboarding.tsx-149-153 (1)
149-153: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize the progress value too.
The progressbar still exposes hardcoded English on Line 154 (
Step … of …) to screen readers. Put that value in a catalog key with current/total interpolation.mobile/src/components/pr-sidebar/markdown-blocks.ts-71-71 (1)
71-71: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize empty
<summary>fallbacks too.Line 71 only handles a missing tag; whitespace-only summaries still fall through to the hardcoded English fallback at Line 73. Normalize the extracted summary with
|| t('m.B0fOGkI').mobile/src/components/use-codex-reset-credit-action.ts-15-21 (1)
15-21: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize the missing-account identity.
Line 17 passes English text into otherwise translated scope copy when the account is absent. Replace it with a translated fallback before interpolating it.
mobile/src/components/MobileDiffReviewHeader.tsx-108-111 (1)
108-111: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winTranslate every filter value.
Only
allusest(...); values such asreviewedandunreviewedremain English in both visible and accessibility text. Map eachMobileDiffReviewQueueFiltervalue to a localized label before rendering.mobile/src/components/codex-reset-credit.ts-82-82 (1)
82-82: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winDo not interpolate English plural nouns.
value1is always"reset"or"resets", so non-English catalogs that include it still render an English noun. Select localized singular/plural catalog entries based oncountand interpolate only the number.mobile/src/components/pr-sidebar/PRCommentCard.tsx-143-143 (1)
143-143: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep the external-link label provider-neutral.
This generic comment card uses a translation described as “Open comment on GitHub,” but it also supports non-GitHub hosts. GitLab comments would therefore be announced as GitHub. Use neutral wording such as “Open comment in browser,” or select the label from explicit provider state.
As per coding guidelines, source-control and review changes must support GitLab and other supported providers and avoid GitHub-only names for generic review concepts.
Source: Coding guidelines
mobile/src/components/MobileRichMarkdownEditor.tsx-94-108 (1)
94-108: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winResolve toolbar labels at render time.
These labels are fixed when the module loads, so an in-app locale change leaves the toolbar in the prior language. Store translation keys and call
t()while rendering each item.mobile/src/components/pr-sidebar/PRCommentsSection.tsx-199-202 (1)
199-202: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep complete user-facing sentences in locale catalogs. Both sites compose English grammar outside
t(), which prevents non-English locales from translating or reordering the message.
mobile/src/components/pr-sidebar/PRCommentsSection.tsx#L199-L202: pass counts as interpolation values; move the “of remaining” wording into a translation key.mobile/src/components/pr-sidebar/PRConflictingFilesSection.tsx#L76-L108: replace hardcoded notice branches and manual plural suffixes with keyed, count-aware translations.mobile/src/components/VoiceModelList.tsx-104-108 (1)
104-108: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winTranslate the complete accessibility labels.
The catalog entries are standalone
"Delete"and"Download"strings, but direct concatenation withmodel.labelproduces labels likeDeleteModeland prevents locale-specific word order. Add dedicated interpolated catalog entries for the full labels instead of concatenating translated fragments.Also applies to: 120-124
mobile/src/components/WorktreeListRow.tsx-187-187 (1)
187-187: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winTranslate the complete child-count phrase.
The count is concatenated with standalone singular/plural nouns, which assumes English word order and pluralization. Use a locale-specific message with count interpolation so supported locales can format the entire phrase correctly.
🧹 Nitpick comments (11)
config/scripts/audit-localization-coverage.mjs (2)
115-117: 🎯 Functional Correctness | 🔵 Trivial | 💤 Low valueSnake_case exclusion applies to the desktop renderer audit too.
hasHumanLanguageTextis shared by all source roots, so this new rule also silently drops any renderer candidate that is entirelylower_snake_case(e.g. a legitimate lowercase message such assave_failedused as UI copy). Consider gating it to the mobile path if the intent is mobile identifier noise reduction.
401-407: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueHardcoded mobile subdirectory allowlist will silently drift.
userVisibleErrorSourceomitsmobile/src/{terminal,transport,worktree,storage,diagnostics,onboarding}, so user-facingnew Error(...)/Error(...)copy there is never reported, and any new feature directory defaults to "not user-visible" without a signal. Consider inverting to an explicit non-UI denylist, or hoisting the directory list next toclassifyMobileStringNodeinconfig/scripts/mobile-localization-candidate-rules.mjsso the classifier and its scope stay together.config/scripts/bootstrap-mobile-locale-catalog.mjs (3)
173-187: 🗄️ Data Integrity & Integration | 🔵 Trivial | 💤 Low valueConcurrent
saveCachewrites to the same path can interleave.Three workers share
completed, so multiplecompleted % 25 === 0checkpoints can't overlap, but a checkpoint write can still overlap a later one from another worker sincesaveCacheis awaited per-worker, not serialized. Non-atomicfs.writeFileto the same file can leave truncated JSON (recoverable only becauseloadCacheswallows parse errors). Simplest fix: write to${cachePath}.tmpthenfs.rename, or guard checkpoints with a single in-flight promise.
35-44: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winPlaceholder restoration is case- and spacing-sensitive.
The four hardcoded patterns won't catch other manglings the endpoint produces (e.g. lowercased
__ph0__, or_ _PH0_ _), and a lost token becomes a placeholder-parity failure inconfig/scripts/verify-mobile-localization-catalog.mjs. A single case-insensitive regex per index is more robust:♻️ Suggested refactor
- const patterns = [`__PH${index}__`, `__ PH ${index} __`, `__PH ${index}__`, `__ PH${index}__`] - for (const pattern of patterns) { - result = result.replaceAll(pattern, tokens[index]) - } + result = result.replace( + new RegExp(`_\\s*_\\s*PH\\s*${index}\\s*_\\s*_`, 'gi'), + () => tokens[index] + )
108-136: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winDesktop catalog seeding hard-fails when a desktop locale file is absent.
seedFromDesktopCatalogthrows ifsrc/renderer/src/i18n/locales/<locale>.jsondoesn't exist, aborting the whole bootstrap even though seeding is only an optimization. Wrapping the reads and warning would keep the script usable for locales the desktop app doesn't ship.config/scripts/localize-mobile-strings.mjs (1)
233-282: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider a
--dry-runflag for this in-place codemod.
localizeFilerewrites sources unconditionally with no preview or clean-tree check; a dry-run that prints planned edits and catalog additions would make reruns safer.config/scripts/mobile-localization-candidate-rules.mjs (1)
106-151: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoffHardcoded product function names couple the tooling to app internals.
~45 app-specific formatter names live in a generic audit script; renames in
mobile/srcsilently degrade classification with no failure signal. Consider sourcing this list from a data file next to the mobile code, or at least asserting the names still resolve during verification.config/scripts/verify-mobile-localization-catalog.mjs (1)
149-166: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueOnly a bare
tcallee is verified.
taccessed via alias (import { t as translate }) or namespace (i18n.t(...)) bypasses key/placeholder verification entirely, so the gate can silently pass unverified call sites. Consider also resolving the imported binding name from@/i18n/mobile-i18n.config/scripts/verify-mobile-localization-catalog.test.mjs (1)
15-28: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueTemp directories are never cleaned up.
Each
makeProjectcall leaves a directory intmpdir(). Track the roots and remove them in anafterEach/afterAllwithrmSync(root, { recursive: true, force: true }).config/localization-audit.md (1)
56-67: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueReconcile the mobile catalog refresh section with the whole-catalog overwrite policy.
The documented
bootstrap:mobile:*-catalogscripts are valid package entry points, but they also clone the English catalog and write back the target locale file; move this into the “legacy free-endpoint bootstrap/whole-catalog repair” policy wording or explain the intended cache-backed exception.mobile/src/components/CustomKeyModal.tsx (1)
36-37: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueShorten this comment.
Keep the rationale to one concise line. As per coding guidelines, “Comments must be concise, limited to non-obvious information, and preferably one line.”
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: db5dbc1e-a29c-4809-87a6-54b7be064c04
⛔ Files ignored due to path filters (1)
mobile/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (263)
.gitignoreconfig/localization-audit.mdconfig/mobile-localization-coverage-allowlist.jsonconfig/scripts/audit-localization-coverage.mjsconfig/scripts/bootstrap-mobile-locale-catalog.mjsconfig/scripts/localize-mobile-strings.mjsconfig/scripts/mobile-localization-candidate-rules.mjsconfig/scripts/verify-mobile-localization-catalog.mjsconfig/scripts/verify-mobile-localization-catalog.test.mjsmobile/app.jsonmobile/app/about.tsxmobile/app/browser-settings.tsxmobile/app/connection-log.tsxmobile/app/h/[hostId]/accounts.tsxmobile/app/h/[hostId]/edit.tsxmobile/app/h/[hostId]/index.tsxmobile/app/h/[hostId]/session/QuickCommandsTabButton.tsxmobile/app/h/[hostId]/session/[worktreeId].tsxmobile/app/h/[hostId]/tasks.tsxmobile/app/h/_layout.tsxmobile/app/index.tsxmobile/app/mobile-onboarding.tsxmobile/app/native-chat-settings.tsxmobile/app/notifications.tsxmobile/app/pair-confirm.tsxmobile/app/pair-scan.tsxmobile/app/pair.tsxmobile/app/settings.tsxmobile/app/terminal-settings.tsxmobile/app/troubleshoot.tsxmobile/app/voice-settings.tsxmobile/locales/en.jsonmobile/locales/es.jsonmobile/locales/ja.jsonmobile/locales/ko.jsonmobile/locales/zh-Hans.jsonmobile/package.jsonmobile/src/agent-history/MobileAgentSessionHistoryList.tsxmobile/src/agent-history/MobileAgentSessionHistoryPanel.tsxmobile/src/agent-history/agent-history-resume-target.tsmobile/src/agent-history/agent-history-session-card.tsmobile/src/agent-history/use-mobile-agent-history-state.tsmobile/src/agent-history/worktree-navigation-actions.tsmobile/src/browser/MobileBrowserKeyRow.tsxmobile/src/browser/MobileBrowserPane.tsxmobile/src/browser/MobileBrowserPointerModifiers.tsxmobile/src/browser/MobileBrowserViewModeSwitch.tsxmobile/src/components/AuthFailedBanner.tsxmobile/src/components/CodexResetCreditAction.tsxmobile/src/components/ConfirmModal.tsxmobile/src/components/CustomKeyModal.tsxmobile/src/components/DragReorderList.tsxmobile/src/components/HostProtocolGate.tsxmobile/src/components/MobileDictationSetupSheet.tsxmobile/src/components/MobileDiffReviewBody.tsxmobile/src/components/MobileDiffReviewDrawers.tsxmobile/src/components/MobileDiffReviewFileSummary.tsxmobile/src/components/MobileDiffReviewFooter.tsxmobile/src/components/MobileDiffReviewHeader.tsxmobile/src/components/MobileDiffReviewLine.tsxmobile/src/components/MobileHostCard.tsxmobile/src/components/MobileHtmlPreview.tsxmobile/src/components/MobileMarkdown.tsxmobile/src/components/MobilePRSidebar.tsxmobile/src/components/MobilePrBasePicker.tsxmobile/src/components/MobileRichMarkdownEditor.tsxmobile/src/components/MobileSearchField.tsxmobile/src/components/MobileWorkspaceNameInput.tsxmobile/src/components/NewWorkspaceFab.tsxmobile/src/components/NewWorktreeModal.tsxmobile/src/components/ProtocolBlockScreen.tsxmobile/src/components/SetupHookTrustDrawer.tsxmobile/src/components/SmartWorkspaceAdvancedFields.tsxmobile/src/components/SmartWorkspaceSourceDrawer.tsxmobile/src/components/SmartWorkspaceSourceField.tsxmobile/src/components/SmartWorkspaceSourceRow.tsxmobile/src/components/TerminalShortcutSettings.tsxmobile/src/components/TextInputModal.tsxmobile/src/components/VoiceModelList.tsxmobile/src/components/WorkspaceDetailPlaceholder.tsxmobile/src/components/WorktreeListRow.tsxmobile/src/components/accounts-snapshot.tsmobile/src/components/codex-reset-credit.tsmobile/src/components/mounted-bottom-drawer.tsxmobile/src/components/new-worktree-agent-selection.tsmobile/src/components/pr-sidebar/MermaidDiagram.tsxmobile/src/components/pr-sidebar/MobileLinkPrForm.tsxmobile/src/components/pr-sidebar/MobilePrComposeForm.tsxmobile/src/components/pr-sidebar/MobilePrViewPanel.tsxmobile/src/components/pr-sidebar/PRActionsSection.tsxmobile/src/components/pr-sidebar/PRCheckDetail.tsxmobile/src/components/pr-sidebar/PRChecksSection.tsxmobile/src/components/pr-sidebar/PRCommentCard.tsxmobile/src/components/pr-sidebar/PRCommentComposer.tsxmobile/src/components/pr-sidebar/PRCommentsSection.tsxmobile/src/components/pr-sidebar/PRConflictingFilesSection.tsxmobile/src/components/pr-sidebar/PRReviewersSection.tsxmobile/src/components/pr-sidebar/PRSidebarHeader.tsxmobile/src/components/pr-sidebar/PrSidebarCreateEmptyState.tsxmobile/src/components/pr-sidebar/ReviewerPickerDrawer.tsxmobile/src/components/pr-sidebar/markdown-blocks.tsmobile/src/components/pr-sidebar/pr-check-detail-content.tsmobile/src/components/pr-sidebar/pr-checks-presentation.tsmobile/src/components/pr-sidebar/pr-comment-audience.tsmobile/src/components/pr-sidebar/pr-comment-time.tsmobile/src/components/use-codex-reset-credit-action.tsmobile/src/diagnostics/troubleshoot-common-issues.tsxmobile/src/dictation/mobile-dictation-setup.tsmobile/src/files/MobileFileExplorerPanel.tsxmobile/src/files/MobileFileMarkdownPreview.tsxmobile/src/files/MobileFilePreviewBody.tsxmobile/src/files/MobileFilePreviewEditableSource.tsxmobile/src/files/MobileFilePreviewScreen.tsxmobile/src/files/MobileFilePreviewSourceText.tsxmobile/src/files/mobile-file-explorer-row.tsxmobile/src/files/mobile-file-mutation-ownership.tsmobile/src/files/mobile-file-preview-request.tsmobile/src/files/mobile-file-preview-response.tsmobile/src/files/mobile-file-preview-route.tsmobile/src/hooks/mobile-dictation-desktop-start.tsmobile/src/hooks/mobile-dictation-keep-awake.tsmobile/src/hooks/mobile-dictation-pending-audio-budget.tsmobile/src/hooks/use-mobile-dictation.tsmobile/src/i18n/expo-localization-vitest-stub.tsmobile/src/i18n/locales/en.jsonmobile/src/i18n/locales/es.jsonmobile/src/i18n/locales/ja.jsonmobile/src/i18n/locales/ko.jsonmobile/src/i18n/locales/zh.jsonmobile/src/i18n/mobile-i18n.test.tsmobile/src/i18n/mobile-i18n.tsmobile/src/onboarding/MobileOnboardingPage.tsxmobile/src/session/MobileAgentWorkingIndicator.tsxmobile/src/session/MobileBrowserTabActionSheet.tsxmobile/src/session/MobileNativeChatAsk.tsxmobile/src/session/MobileNativeChatComposer.tsxmobile/src/session/MobileNativeChatMessage.tsxmobile/src/session/MobileNativeChatQuestion.tsxmobile/src/session/MobileNativeChatView.tsxmobile/src/session/MobileSessionHeaderMoreActionsSheet.tsxmobile/src/session/MobileTerminalInputActions.tsxmobile/src/session/MobileTerminalLiveInputStatus.tsxmobile/src/session/QuickCommandEditorForm.tsxmobile/src/session/QuickCommandsList.tsxmobile/src/session/QuickCommandsSheet.tsxmobile/src/session/ai-vault-resume-launch.tsmobile/src/session/ai-vault-resume-preparation.tsmobile/src/session/floating-workspace.tsmobile/src/session/github-pr-mutations.tsmobile/src/session/github-pr-rpc.tsmobile/src/session/mobile-bulk-close-sheet-actions.tsmobile/src/session/mobile-clipboard-image.tsmobile/src/session/mobile-diff-comments.tsmobile/src/session/mobile-diff-review-loaders.tsmobile/src/session/mobile-diff-review-queue.tsmobile/src/session/mobile-diff-review-rpc.tsmobile/src/session/mobile-diff-review-screen-model.tsmobile/src/session/mobile-native-chat-permission-send.tsmobile/src/session/mobile-native-chat-permission.tsmobile/src/session/mobile-native-chat-question.tsmobile/src/session/mobile-native-chat-render-data.tsmobile/src/session/mobile-native-chat-stream-frame.tsmobile/src/session/mobile-native-chat-toggle-action.tsmobile/src/session/mobile-pr-sidebar-state.tsmobile/src/session/mobile-session-route-helpers.tsmobile/src/session/mobile-session-startup-source.test.tsmobile/src/session/mobile-tab-close-selection.tsmobile/src/session/mobile-terminal-action-sheet-actions.tsmobile/src/session/mobile-terminal-records.tsmobile/src/session/mobile-terminal-tab-agent.tsmobile/src/session/pr-actions-engine.tsmobile/src/session/pr-ai-triage-launch.tsmobile/src/session/quick-commands-tab-stability-source.test.tsmobile/src/session/use-mobile-attachment-input-lease-gate.tsmobile/src/session/use-mobile-diff-review-comment-actions.tsmobile/src/session/use-mobile-diff-review-controller.tsmobile/src/session/use-mobile-diff-review-git-actions.tsmobile/src/session/use-mobile-diff-review-interactions.tsmobile/src/session/use-mobile-diff-review-send-actions.tsmobile/src/session/use-mobile-image-attachment.tsmobile/src/session/use-mobile-native-chat-answer-send.tsmobile/src/session/use-mobile-native-chat-cancel-ask.tsmobile/src/session/use-mobile-native-chat-image-attachments.tsmobile/src/session/use-mobile-native-chat-message-send.tsmobile/src/session/use-mobile-native-chat-stop.tsmobile/src/session/use-mobile-pr-actions.tsmobile/src/session/use-mobile-pr-ai-triage.tsmobile/src/session/use-mobile-pr-comment-actions.tsmobile/src/session/use-mobile-pr-title-action.tsmobile/src/session/use-mobile-terminal-paste.tsmobile/src/session/use-quick-commands.tsmobile/src/session/worktree-label.tsmobile/src/source-control/MobileBranchDiffPreviewDrawer.tsxmobile/src/source-control/MobileCommitFailurePanel.tsxmobile/src/source-control/MobileGitHistoryList.tsxmobile/src/source-control/MobileSourceControlBranchCard.tsxmobile/src/source-control/MobileSourceControlContent.tsxmobile/src/source-control/MobileSourceControlFileRows.tsxmobile/src/source-control/MobileSourceControlHeader.tsxmobile/src/source-control/MobileSourceControlModals.tsxmobile/src/source-control/MobileSourceControlPanel.tsxmobile/src/source-control/MobileSourceControlPrChip.tsxmobile/src/source-control/hosted-review-copy.tsmobile/src/source-control/mobile-branch-base-ref.tsmobile/src/source-control/mobile-branch-compare.tsmobile/src/source-control/mobile-commit-message-ai.tsmobile/src/source-control/mobile-create-pr-action.tsmobile/src/source-control/mobile-git-history.tsmobile/src/source-control/mobile-git-status.tsmobile/src/source-control/mobile-hosted-review-create-intent.tsmobile/src/source-control/mobile-hosted-review-git-preparation.tsmobile/src/source-control/mobile-hosted-review-remote-prerequisite.tsmobile/src/source-control/mobile-hosted-review-service.tsmobile/src/source-control/mobile-pr-create.tsmobile/src/source-control/mobile-pr-link.tsmobile/src/source-control/mobile-source-control-actions.tsmobile/src/source-control/mobile-source-control-conflict-abort.tsmobile/src/source-control/mobile-source-control-hub-tab.tsmobile/src/source-control/mobile-source-control-primary-action.tsmobile/src/source-control/mobile-source-control-screen-state.tsmobile/src/source-control/pr-compose-validation.tsmobile/src/source-control/use-mobile-commit-failure-recovery.tsmobile/src/source-control/use-mobile-commit-message-generation.tsmobile/src/source-control/use-mobile-create-pr-runner.tsmobile/src/source-control/use-mobile-git-requests.tsmobile/src/source-control/use-mobile-source-control-action-sheet-runners.tsmobile/src/source-control/use-mobile-source-control-commit-runners.tsmobile/src/source-control/use-mobile-source-control-loaders.tsmobile/src/source-control/use-mobile-source-control-openers.tsmobile/src/source-control/use-mobile-source-control-runners.tsmobile/src/source-control/use-mobile-source-control-state.tsmobile/src/storage/codex-reset-attempt-journal.tsmobile/src/tasks/linear-mobile-issue-read.tsmobile/src/tasks/mobile-github-project-group-sort.tsmobile/src/tasks/mobile-smart-source-modes.tsmobile/src/tasks/mobile-tui-agents.tsmobile/src/tasks/mobile-work-items.tsmobile/src/tasks/sparse-preset-draft.tsmobile/src/tasks/use-mobile-composer-source.tsmobile/src/tasks/workspace-agent-selection.tsmobile/src/tasks/workspace-ssh-gate.tsmobile/src/tasks/worktree-create-retry.tsmobile/src/terminal/TerminalWebView.tsxmobile/src/terminal/terminal-accessory-key-catalog.tsmobile/src/terminal/terminal-accessory-keys.tsmobile/src/terminal/terminal-live-input-affordance.test.tsmobile/src/terminal/terminal-webview-engine-error-state.tsxmobile/src/terminal/terminal-webview-notification-dispatch.tsmobile/src/terminal/terminal-webview-ready-watchdog.tsmobile/src/transport/connection-health.tsmobile/src/transport/host-endpoint.tsmobile/src/transport/mobile-connection-path-label.tsmobile/src/transport/mobile-endpoint-supervisor.tsmobile/src/transport/mobile-relay-host-overlay.tsmobile/src/transport/mobile-relay-rpc-streams.tsmobile/src/transport/pair-confirm-state.tsmobile/src/worktree/agent-row-display.tsmobile/src/worktree/mobile-workspace-statuses.tsmobile/src/worktree/workspace-list-picker-options.tsmobile/src/worktree/workspace-list-sections.tsmobile/src/worktree/workspace-pr-status-groups.tsmobile/vitest.config.tspackage.json
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
mobile/app/h/[hostId]/session/[worktreeId].tsx (1)
3919-3922: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize the quick-command failure template.
A localized label is interpolated into hardcoded
"Couldn't run ...", producing mixed-language errors. Use an interpolatedt(...)entry for the whole message.mobile/app/h/[hostId]/index.tsx (1)
883-892: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winInconsistent formatting for the same translation key
m.2hirWvg.This embedded filter chip interpolates
` ${activeFilterCount}`(leading space, no parens) intot('m.2hirWvg', ...), while the non-embedded toolbar (line 1022) interpolates` (${activeFilterCount})`(parens) into the same key. Since the surrounding punctuation is baked into the interpolated value rather than the translation template, the label renders as "Filters 3" here vs "Filters (3)" there for identical semantics — likely an unintentional divergence from the hardcoded-string refactor.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: f7c9e88f-9a9d-4c91-9c16-dc396ff1e466
📒 Files selected for processing (33)
.github/workflows/pr.ymlconfig/scripts/bootstrap-mobile-locale-catalog.mjsconfig/scripts/bootstrap-mobile-locale-catalog.test.mjsconfig/scripts/localize-mobile-strings.mjsconfig/scripts/mobile-localization-candidate-rules.mjsconfig/scripts/mobile-localization-candidate-rules.test.mjsconfig/scripts/verify-mobile-localization-catalog.mjsconfig/scripts/verify-mobile-localization-catalog.test.mjsmobile/app/_layout.tsxmobile/app/h/[hostId]/index.tsxmobile/app/h/[hostId]/session/[worktreeId].tsxmobile/app/h/[hostId]/tasks.tsxmobile/src/components/MobileDiffReviewFileSummary.tsxmobile/src/components/MobileDiffReviewHeader.tsxmobile/src/components/codex-reset-credit.test.tsmobile/src/components/codex-reset-credit.tsmobile/src/components/pr-sidebar/PRCommentsSection.test.tsmobile/src/components/pr-sidebar/PRCommentsSection.tsxmobile/src/components/pr-sidebar/PRConflictingFilesSection.tsxmobile/src/i18n/locales/en.jsonmobile/src/i18n/locales/es.jsonmobile/src/i18n/locales/ja.jsonmobile/src/i18n/locales/ko.jsonmobile/src/i18n/locales/zh.jsonmobile/src/i18n/mobile-i18n.test.tsmobile/src/i18n/mobile-i18n.tsmobile/src/i18n/use-mobile-locale-reload.tsmobile/src/session/mobile-diff-review-screen-model.test.tsmobile/src/session/mobile-diff-review-screen-model.tsmobile/src/session/mobile-session-startup-source.test.tsmobile/src/session/session-refresh-timer.tsmobile/src/source-control/mobile-source-control-conflict-abort.test.tsmobile/src/source-control/mobile-source-control-conflict-abort.ts
🚧 Files skipped from review as they are similar to previous changes (6)
- mobile/src/components/pr-sidebar/PRCommentsSection.tsx
- mobile/src/components/MobileDiffReviewFileSummary.tsx
- mobile/src/i18n/locales/ja.json
- mobile/src/components/pr-sidebar/PRConflictingFilesSection.tsx
- mobile/src/i18n/locales/es.json
- mobile/src/i18n/locales/zh.json
…18n-audit # Conflicts: # mobile/app/h/[hostId]/edit.tsx
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
mobile/app/h/[hostId]/edit.tsx (1)
58-60: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep all user-facing errors translatable.
The
Error.messagebranches andendpointEdit.errorrender raw strings instead of catalog keys. Normal failures and invalid endpoint feedback can therefore remain English on non-English locales. Map known errors to stable i18n keys, with a localized generic fallback for unknown errors.Also applies to: 93-95, 116-120, 237-242
mobile/app/h/[hostId]/session/[worktreeId].tsx (1)
3917-3921: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winRemove the remaining hard-coded English from this localized session flow.
mobile/app/h/[hostId]/session/[worktreeId].tsx#L3917-L3921: replaceCouldn't run ${label}with an interpolated translation key.mobile/app/h/[hostId]/session/[worktreeId].tsx#L5206-L5371: replace the rename modal’s'Terminal'fallback with the translated terminal-title key.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 3ff1fc7f-7216-40ac-89ed-8678f8b8b8af
📒 Files selected for processing (4)
mobile/app/h/[hostId]/edit.tsxmobile/app/h/[hostId]/session/[worktreeId].tsxmobile/app/index.tsxpackage.json
🚧 Files skipped from review as they are similar to previous changes (1)
- mobile/app/index.tsx
|
I opened #11587 as a focused stacked follow-up for the mobile i18n blockers discussed here. It fixes the locale-dependent SSH sentinel, missing-repository grouping identity/key collisions, confirmed Simplified Chinese catalog pollution/mistranslations, translation-request timeout/response validation, and the iOS mixed-localization flag. It targets this PR branch directly and relates to #9536. |
|
Follow-up update on #11587: it now includes mocked |
|
I do not have write access to this PR's source branch, so I resolved the latest |
…11446-i18n-ctx-a963 # Conflicts: # mobile/src/session/use-mobile-native-chat-message-send.ts # src/main/daemon/daemon-pty-router.ts
|
Resolved the two conflicts against Validation is green: Architecture verdict: compatible only as an explicit migration bridge, not as the steady-state PO design. This PR enforces strict-parity JSON target catalogs and includes a whole-catalog target bootstrap, while #11478 explicitly calls in-flight mobile JSON a bridge and requires mobile-owned PO sources plus a read-only compiler/reconciler; I did not expand this conflict resolution into that migration. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
mobile/app/h/[hostId]/session/[worktreeId].tsx (2)
3779-3792: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick winAdd end-to-end deadlines for terminal creation and initial-prompt delivery.
These RPCs have no explicit timeout. A reconnect can leave terminal creation locked indefinitely, while the detached prompt send can remain unresolved without user feedback. Use bounded request deadlines that span reconnect and handle timeout as a retryable failure.
Also applies to: 3836-3866
Source: Learnings
3921-3921: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winLocalize the remaining terminal fallbacks.
The quick-command failure and untitled-terminal rename default remain English. Route both through catalog keys, with interpolation for the command label.
Also applies to: 5321-5325
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 95c2e77e-c0fc-4839-a85d-9c6ba106de34
📒 Files selected for processing (4)
mobile/app/h/[hostId]/session/[worktreeId].tsxmobile/src/session/mobile-terminal-records.tsmobile/src/session/use-mobile-native-chat-image-attachments.tsmobile/src/session/use-mobile-native-chat-message-send.ts
…18n-audit # Conflicts: # mobile/app/h/[hostId]/session/[worktreeId].tsx # mobile/app/h/[hostId]/tasks.tsx # mobile/src/transport/connection-health.ts
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
mobile/app/h/[hostId]/session/[worktreeId].tsx (1)
3928-3928: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winKeep user-facing fallbacks in the translation catalog.
The quick-command failure toast and rename-modal fallback still bypass i18next. Non-English users will see English in these paths; use a translated interpolation key for the former and
t('m.1ELofI0')for the"Terminal"fallback.Also applies to: 5324-5324
mobile/app/h/[hostId]/tasks.tsx (1)
9354-9370: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winUnresolved from a prior review: literal
'Empty'string comparisons break for non-English locales.
isEmpty = value === 'Empty'(project field pill styling) andcurrentLabel === 'Empty'(Clear-button disabled state) still compare against the raw English literal, butprojectFieldValueLabel/projectFieldDisplayLabelnow return a localized empty-value string (per this PR's localization of project-field helpers,985-2040). In es/ja/ko/zh locales this means the muted empty styling never applies and the Clear button stays enabled for already-empty fields. A prior review on this exact file flagged this and it does not appear to have been addressed in the code shown here.Expose emptiness as data (e.g., a boolean
isProjectFieldEmpty(row, field)alongside the label) rather than string-matching the display text, and use it at both call sites.Also applies to: 11893-11906
mobile/src/session/mobile-terminal-action-sheet-actions.ts (1)
76-80: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPrune the local terminal record when closing a session tab.
This new branch calls
onCloseSessionTab, buthandleCloseSessionTabinmobile/app/h/[hostId]/session/[worktreeId].tsxonly unsubscribes and clears refs at Lines 4137-4143. It does not remove the terminal fromterminals/terminalsRef, so the closed pane can remain rendered until a later snapshot. Prune it immediately in the session-tab close path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 99afef63-0339-4384-b58b-623bdb952750
📒 Files selected for processing (14)
.gitignoremobile/app/h/[hostId]/session/[worktreeId].tsxmobile/app/h/[hostId]/tasks.tsxmobile/src/i18n/locales/en.jsonmobile/src/i18n/locales/es.jsonmobile/src/i18n/locales/ja.jsonmobile/src/i18n/locales/ko.jsonmobile/src/i18n/locales/zh.jsonmobile/src/session/mobile-session-route-helpers.tsmobile/src/session/mobile-session-startup-source.test.tsmobile/src/session/mobile-terminal-action-sheet-actions.tsmobile/src/tasks/mobile-hosted-check-status.tsmobile/src/transport/connection-health.tspackage.json
🚧 Files skipped from review as they are similar to previous changes (4)
- mobile/src/i18n/locales/zh.json
- package.json
- mobile/src/i18n/locales/ja.json
- mobile/src/i18n/locales/en.json
…2025/mobile-i18n-audit
…18n-audit # Conflicts: # mobile/app/h/[hostId]/index.tsx # mobile/app/index.tsx # mobile/pnpm-lock.yaml # mobile/src/components/MobileHostCard.tsx # mobile/src/components/MobileMarkdown.tsx # mobile/src/components/pr-sidebar/MermaidDiagram.tsx # mobile/src/session/MobileNativeChatComposer.tsx # mobile/src/session/MobileNativeChatMessage.tsx # mobile/src/session/mobile-native-chat-permission-send.ts # mobile/src/session/mobile-native-chat-render-data.ts # mobile/src/session/use-mobile-diff-review-controller.ts # mobile/src/session/use-mobile-native-chat-answer-send.ts # mobile/src/session/use-mobile-native-chat-image-attachments.ts # mobile/src/session/use-mobile-native-chat-message-send.ts # mobile/src/terminal/terminal-webview-notification-dispatch.ts # mobile/src/transport/mobile-endpoint-supervisor.ts
…18n-audit # Conflicts: # mobile/src/session/MobileTerminalLiveInputStatus.tsx # mobile/src/terminal/terminal-live-input-affordance.test.ts
|
Close this older whole-app localization patch after creating a GitHub issue for translating the current phone screens and native shell. Rebuild it from the code now on main. The remaining problem is tracked in #27647. |
Summary
Relationship to the shared PO localization contract
This PR is intentionally aligned with the canonical gettext PO architecture documented in #11478, rather than establishing a second mobile-specific translation pipeline:
m.*IDs: 2,149 referenced entries now use intent-named IDs, five genuine duplicates were consolidated, 26 orphan keys were removed, and 288 positional placeholders were renamed semantically. Verification now owns orphan, copied-English, terminology, protected-literal, binding, and placeholder checks without reviving generated-catalog ownership.Validation
9629bc55851f2478af827380216e40bc10632cca, tree2c298a3152a0ecd20ca0f26bd1dc673be36c90a7(fresh same-model/same-reasoning exact-head review:CLEAN)pnpm exec oxlintpnpm run audit:code-quality:nativepnpm run audit:code-quality:type-awarepnpm run typecheckpnpm run check:reliability-gatespnpm run check:max-lines-ratchetpnpm run check:code-quality:changed -- b04c695750e9859e0d8bf79f503279bc4d656925(0 findings across 312 changed files, including type-aware and React Doctor checks)mobile/pnpm-lock.yamlRaw ambiguous write, and removing the companion member-cycle guard reproduced the exact stack overflow before production was restored1cedf2d7aasame-model review result: not clean with seven findings; snapshot-site resolution, allocation identity, loop back-edges, logical/member rendered writes, destructuring patterns/defaults, selector constants, and namespace spreads were fixed, and one grouped control reversion made exactly 7/7 new regression tests fail before production was restoredpnpm run verify:localization-catalog(11,003 references)pnpm run verify:localization-extraction(9,768 keys)pnpm run verify:mobile-localization-catalog(2,700 calls and 2,242 catalog keys across 5 locales)pnpm run verify:localization-coveragegit merge-tree --write-tree 9629bc55851f2478af827380216e40bc10632cca 79896cb9a609a7371ccdb6bdccd76853034da38f(clean; tree2c298a3152a0ecd20ca0f26bd1dc673be36c90a7equals the exact head tree)cd mobile && expo config --type public --jsonSimulator validation
Earlier exact-head A/B: PASS on
PR 8647 QA iPhone(8BF243A1-DBBF-40F8-A8D3-7A64FF90C2DF) with the device locale held in Spanish. The installed app, simulator data, and device settings were unchanged; only the Metro bundle moved between the exact comparison commits.8c5371ebadc95eb47a86ff7289a7fa06e3cdb9ee: the mobile home screen remained in English.66bbf07d0a10d5b6a5e419e8e9d504d6c1a2d595: the home screen rendered in Spanish, and the longerNuevo espacio de trabajolabel wrapped cleanly inside its card.Fresh multilingual screenshots
A fresh native build with
ExpoLocalizationwas exercised on committed localization headd88a577ac9a9e153a9ff19fa30413b536c264ab3in Spanish and Japanese. Accessibility inspection confirmed translated interface text and Spanish quick-action wrapping. These screenshots are stale by Git SHA relative to final pushed head9629bc55851f2478af827380216e40bc10632cca; the later commits merged currentmainand split a type-only native-chat controller contract, while the mobile home UI and locale catalogs remained byte-for-byte unchanged.What the user sees before and after
Before: Mobile users whose device is set to a supported non-English language still see English interface text, and longer translated quick actions can clip inside their cards.
After: The mobile interface follows the supported device language, and longer localized quick-action labels wrap cleanly inside their cards.