Repository navigation
Decouple feature copy from translated locale catalogs - #8488
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe PR establishes a localization extraction and verification pipeline with cross-platform CI enforcement. It adds catalog and source-reference tooling, dynamic-call allowlists, disposition tracking, reviewed-translation provenance, locale state generation, and migration-only rewrite guards. Catalogs and UI translations are updated across supported languages, with interpolation placeholders standardized in many call sites. Generated localization key types, product coverage checks, status reporting, documentation, ownership rules, and targeted tests are also added. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 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: 8
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
config/scripts/locale-translation-policy.mjs (1)
599-616: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winPropagate the mobile-hero
Continueexception to cache repair.repairCacheMap()still callsshouldPreserveEnglishValue(enValue)without a key, so the newTRANSLATABLE_VALUE_CONTEXT_KEYSoverride is skipped there. Because the cache is reused by English value alone,Continuecan be translated inrepairCatalog()but forced back to English in the cache.
🧹 Nitpick comments (7)
config/scripts/bootstrap-locale-catalog.mjs (1)
130-136: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider injecting migration flag/env for testability.
The guard reads
process.argvandprocess.envdirectly, while the rest ofmain()follows a pattern of injectingargv/localeas parameters for testability (seeparseLocaleArg(process.argv)default). Consider accepting these as parameters (with defaults from the realprocessglobals) to make the guard easier to unit test without mutating global state.♻️ Suggested refactor for testability
-export async function main(root = process.cwd(), locale = parseLocaleArg(process.argv)) { - if (!process.argv.includes(MIGRATION_FLAG) || process.env[MIGRATION_ENV] !== '1') { +export async function main( + root = process.cwd(), + locale = parseLocaleArg(process.argv), + argv = process.argv, + env = process.env +) { + if (!argv.includes(MIGRATION_FLAG) || env[MIGRATION_ENV] !== '1') {config/scripts/verify-localization-catalog.test.mjs (1)
134-171: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winSplit the two provenance rejection cases.
This fixture triggers both an unsupported reviewed upgrade and a provenance downgrade. Either validation can regress while the other keeps the test green; assert them in separate tests.
config/scripts/repair-locale-catalog.mjs (1)
9-11: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider accepting injectable argv/env like the sibling bootstrap script.
This guard reads
process.argv/process.envdirectly, whereasbootstrap-localization-state.mjs'smain()(used inbootstrap-localization-state.test.mjsasbootstrapLocalizationState(root, MIGRATION_ARGS, { environment: MIGRATION_ENVIRONMENT })) accepts an explicitargsarray andoptions.environment. Following the same pattern here would make this script testable without mutating global process state.♻️ Proposed refactor
-export async function main(root = process.cwd(), locale = parseLocaleArg(process.argv)) { - if (!process.argv.includes(MIGRATION_FLAG) || process.env[MIGRATION_ENV] !== '1') { +export async function main( + root = process.cwd(), + locale = parseLocaleArg(process.argv), + { argv = process.argv, environment = process.env } = {} +) { + if (!argv.includes(MIGRATION_FLAG) || environment[MIGRATION_ENV] !== '1') { console.error( `Refusing to rewrite locale catalogs. Set ${MIGRATION_ENV}=1 and pass ${MIGRATION_FLAG} for migration-only use.` ) return 1 }Also applies to: 62-68
config/scripts/locale-translation-policy.mjs (1)
341-341: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winHardcoded context key is brittle.
This override is tied to
auto.components.mobile.MobileHero.a8fb43cf1c; if extraction regenerates the hash, the special-case stops applying silently. Add a guard/test that fails when this key disappears from the generated catalog or key map so the policy doesn’t drift..github/workflows/pr.yml (2)
12-41: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winAdd least-privilege
permissions:to the new matrix job.No explicit
permissions:block, so the job inherits default (often broader)GITHUB_TOKENscopes. Since this job only checks out and runs verification,permissions: contents: readis enough.Based on learnings, the zizmor static analysis hint flags "overly broad permissions (excessive-permissions): default permissions used due to no permissions: block" for this line range.🔒️ Proposed fix
localization-extraction-platforms: name: Localization extraction (${{ matrix.os }}) runs-on: ${{ matrix.os }} + permissions: + contents: read strategy:Source: Linters/SAST tools
20-21: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winDisable credential persistence on checkout for this verification-only job.
actions/checkoutdefaults to persisting theGITHUB_TOKENin the local git config; this job never needs to push, sopersist-credentials: falsereduces the token's exposure window.As per the zizmor static analysis hint flagging "credential persistence through GitHub Actions artifacts (artipacked)" for this line range.🔒️ Proposed fix
- name: Checkout uses: actions/checkout@v6 + with: + persist-credentials: falseSource: Linters/SAST tools
config/scripts/localization-git-history.mjs (1)
67-87: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winMinor:
resolveBlobOidsmishandles an emptyspecsarray.With
specs.length === 0,git cat-file --batch-checkproduces no output, but''.split('\n')still yields[''](length 1), tripping thelines.length !== specs.lengthguard and throwing a confusing error instead of returning an empty result. Not reachable today sincespecsalways contains at least one entry per non-emptylocales, but a one-line early return would make this robust against future callers.🛡️ Proposed fix
async function resolveBlobOids(root, specs, onGitProcess) { + if (specs.length === 0) { + return new Map() + } const child = startGit(root, ['cat-file', '--batch-check'], onGitProcess)
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: affe61fb-2317-4616-9c92-eb5bc8630c11
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (76)
.gitattributes.github/CODEOWNERS.github/workflows/pr.ymlconfig/localization-audit.mdconfig/localization-dynamic-call-allowlist.jsonconfig/localization-extraction-dispositions.jsonconfig/localization-extraction/en.jsonconfig/localization-main-process-allowlist.jsonconfig/localization-policy-disposition.mdconfig/localization-reviewed-commit-classifications.jsonconfig/localization-reviewed-corrections.jsonconfig/localization-state/es.jsonconfig/localization-state/ja.jsonconfig/localization-state/ko.jsonconfig/localization-state/zh.jsonconfig/scripts/audit-localization-coverage.mjsconfig/scripts/audit-localization-coverage.test.mjsconfig/scripts/bootstrap-locale-catalog.mjsconfig/scripts/bootstrap-localization-state.mjsconfig/scripts/bootstrap-localization-state.test.mjsconfig/scripts/generate-localization-key-types.mjsconfig/scripts/legacy-localization-rewrite-guard.test.mjsconfig/scripts/locale-translation-policy.mjsconfig/scripts/localization-catalog-model.mjsconfig/scripts/localization-code-unit-order.mjsconfig/scripts/localization-coverage-allowlist-diff.mjsconfig/scripts/localization-coverage-allowlist-schema.mjsconfig/scripts/localization-git-history.mjsconfig/scripts/localization-git-history.test.mjsconfig/scripts/localization-reviewed-provenance.mjsconfig/scripts/localization-source-references.mjsconfig/scripts/localization-source-references.test.mjsconfig/scripts/repair-locale-catalog.mjsconfig/scripts/report-localization-status.mjsconfig/scripts/verify-localization-catalog.mjsconfig/scripts/verify-localization-catalog.test.mjsconfig/scripts/verify-localization-extraction.mjsconfig/scripts/verify-localization-extraction.test.mjsconfig/scripts/verify-product-localization.mjsi18next.config.tspackage.jsonsrc/main/i18n/main-i18n-lazy-locale.test.tssrc/renderer/src/components/GitHubItemDialog.tsxsrc/renderer/src/components/PullRequestPage.tsxsrc/renderer/src/components/linear-issue-attribute-filter-sections.tsxsrc/renderer/src/components/linear-project-view-surfaces.tsxsrc/renderer/src/components/native-chat/NativeChatToolRun.tsxsrc/renderer/src/components/orca-profiles/OrcaProfileManagementDialog.tsxsrc/renderer/src/components/orca-profiles/OrcaProfileProjectTransferConfirmDialog.tsxsrc/renderer/src/components/orca-profiles/OrcaProfileSwitchConfirmDialog.tsxsrc/renderer/src/components/right-sidebar/AiVaultPanel.tsxsrc/renderer/src/components/right-sidebar/SourceControl.tsxsrc/renderer/src/components/right-sidebar/useFileDeletion.tssrc/renderer/src/components/settings/ComputerUsePane.tsxsrc/renderer/src/components/settings/ProjectWindowsRuntimeSetting.tsxsrc/renderer/src/components/settings/RepositoryForkSyncSection.tsxsrc/renderer/src/components/settings/RepositoryIconTabs.tsxsrc/renderer/src/components/settings/SourceControlActionRepoOverrideNote.tsxsrc/renderer/src/components/sidebar/AddRepoCloneStep.tsxsrc/renderer/src/components/sidebar/HostRemoveDialog.tsxsrc/renderer/src/components/sidebar/SidebarWorkspaceOptionsMenu.tsxsrc/renderer/src/components/sidebar/WorkspaceKanbanSettingsMenu.tsxsrc/renderer/src/components/sidebar/WorkspaceStatusAppearancePopover.tsxsrc/renderer/src/components/stats/UsageBreakdownSection.tsxsrc/renderer/src/components/status-bar/WorkspaceSpaceCompactPanel.tsxsrc/renderer/src/components/terminal-pane/terminal-native-file-drop.tssrc/renderer/src/hooks/useSettingsNavigationMetadata.language-switch.test.tsxsrc/renderer/src/i18n/lazy-locale.test.tssrc/renderer/src/i18n/locales/en.jsonsrc/renderer/src/i18n/locales/es.jsonsrc/renderer/src/i18n/locales/ja.jsonsrc/renderer/src/i18n/locales/ko.jsonsrc/renderer/src/i18n/locales/zh.jsonsrc/renderer/src/i18n/native-chat-locales.test.tssrc/renderer/src/store/slices/repos.tssrc/shared/localization-keys.ts
👮 Files not reviewed due to content moderation or server errors (2)
- config/localization-state/es.json
- config/localization-state/ja.json
| "fa90f739a5": "Choose the project, workspace name, and agent before creating the workspace." | ||
| }, | ||
| "PullRequestPage": { | ||
| "2560588245": "Failed to request reviewer", |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Verify whether extraction/verification scripts assert hex-only keys and sorted order.
rg -n "hex|sort|/^[0-9a-f]" config/scripts/verify-localization-extraction.mjs config/scripts/localization-catalog-model.mjs config/scripts/generate-localization-key-types.mjsRepository: stablyai/orca
Length of output: 1983
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== PullRequestPage block =="
sed -n '500,545p' config/localization-extraction/en.json
echo
echo "== SourceControl block =="
sed -n '4528,4540p' config/localization-extraction/en.json
echo
echo "== GrokUsagePane block =="
sed -n '9294,9304p' config/localization-extraction/en.json
echo
echo "== verify-localization-extraction.mjs key checks =="
rg -n "hex|[0-9a-f]{10}|compareCodeUnits|sorted\\(|fallbackDrift|orphans|template.keys|catalog.keys" config/scripts/verify-localization-extraction.mjs
echo
echo "== localization-catalog-model.mjs sorting/model behavior =="
sed -n '1,120p' config/scripts/localization-catalog-model.mjsRepository: stablyai/orca
Length of output: 8396
Regenerate these catalog entries instead of hand-editing them.
PullRequestPagestarts with"2560588245"before"000f90afcf", so this block is no longer in code-unit order.GrokUsagePanealso has keys like"g8h9i0j1k2","h9i0j1k2l3", and"i0j1k2l3m4"that stand out from the rest of the generated entries.
There was a problem hiding this comment.
Leaving this unchanged. JSON.stringify enumerates integer-index keys before ordinary string keys regardless of insertion order, so 2560588245 cannot be forced behind 000f90afcf in a JSON object. The live extractor plus normalization passes on macOS, Linux, Windows, and C versus cs_CZ determinism; the alphanumeric keys are existing explicit identifiers, not malformed generated hashes.
There was a problem hiding this comment.
@brennanb2025, that's a fair and technically correct point — I hadn't accounted for the ECMA-262 integer-key ordering rule. Since "2560588245" is a canonical integer-index string (all digits, no leading zero), JS/JSON key enumeration will always place it ahead of ordinary string keys like "000f90afcf", regardless of insertion order or any sort pass applied by the extractor. So the PullRequestPage ordering isn't a bug — withdrawing that part.
One thing the reply didn't cover: the GrokUsagePane keys I flagged (g8h9i0j1k2, h9i0j1k2l3, i0j1k2l3m4) aren't integer-index keys, so the ordering rule doesn't explain those. They also contain letters g, h, i, j, k that fall outside the 0-9a-f hex alphabet used by the generated hash-style keys elsewhere, and they follow a suspiciously sequential pattern (incrementing by one character each time) rather than the pseudo-random look of the other hashes. Can you confirm these are also existing explicit identifiers (same category as the alphanumeric ones you mentioned) rather than artifacts of a manual edit? If so, I'm happy to leave this as-is too.
(・_・;) still curious about those Grok keys though
✏️ Learnings added
Learnt from: brennanb2025
Repo: stablyai/orca PR: 8488
File: config/localization-extraction/en.json:522-522
Timestamp: 2026-07-13T05:59:51.823Z
Learning: In stablyai/orca, localization extraction files under config/localization-extraction/*.json (and locale catalogs) rely on JSON/JS object key enumeration semantics: canonical non-negative integer string keys (e.g., "2560588245") are always ordered before ordinary string keys (e.g., hash-like "000f90afcf") per ECMA-262, regardless of insertion order or sorting passes. This is expected behavior, not a sign of unsorted/malformed catalog entries, when reviewing key ordering in these generated en.json files.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
There was a problem hiding this comment.
Confirmed. These three Grok keys are explicit identifiers in src/renderer/src/components/stats/GrokUsagePane.tsx and predate this PR in commit fa2b228. They are present unchanged in origin/main, the runtime English catalog, target state, and live extractor output, so they are not manual artifacts introduced by this migration.
There was a problem hiding this comment.
@brennanb2025, thanks for confirming and tracing it back to the source component and commit — that fully accounts for the naming pattern I flagged. Closing this one out.
ヽ(・∀・)ノ
There was a problem hiding this comment.
🧹 Nitpick comments (1)
config/scripts/locale-translation-policy.mjs (1)
341-356: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueConsider documenting the reverse-lookup ambiguity in
translatableContextKeyForValue.
translatableContextKeyForValuereturns the first matching key for a given English value. SincerepairCacheMapis value-only (no key context), if two translatable contexts ever share the same English value, the reverse lookup is ambiguous and only the first registered context key wins. This is fine with a single entry but worth a comment to prevent silent misclassification if the map grows.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: cff485a7-bf80-42e0-a07b-ccbeac35d96c
📒 Files selected for processing (13)
.gitattributes.github/workflows/pr.ymlconfig/scripts/audit-localization-coverage.mjsconfig/scripts/audit-localization-coverage.test.mjsconfig/scripts/bootstrap-locale-catalog.mjsconfig/scripts/legacy-localization-rewrite-guard.test.mjsconfig/scripts/locale-translation-context-policy.test.mjsconfig/scripts/locale-translation-policy.mjsconfig/scripts/localization-coverage-allowlist-diff.mjsconfig/scripts/localization-git-history.mjsconfig/scripts/repair-locale-catalog.mjsconfig/scripts/verify-localization-catalog.mjsconfig/scripts/verify-localization-catalog.test.mjs
🚧 Files skipped from review as they are similar to previous changes (6)
- config/scripts/legacy-localization-rewrite-guard.test.mjs
- .github/workflows/pr.yml
- config/scripts/localization-coverage-allowlist-diff.mjs
- config/scripts/localization-git-history.mjs
- config/scripts/repair-locale-catalog.mjs
- config/scripts/verify-localization-catalog.mjs
* Decouple feature copy from locale catalogs * Update PR workflow contract tests * Address localization review findings * Document localization cache context
…ai#8488)" (stablyai#8500) This reverts commit b37dca5.
New English feature copy can now land without adding placeholder leaves to every translated locale. Missing target entries use the existing English fallback, while existing translations and reviewed corrections remain versioned and protected.
What changed
reviewed,machine,intentional-english, stale, and untranslated classifications.Design and review
The design keeps i18next and the current runtime loading boundary for Phases 1–2. English source identity remains authoritative, target catalogs may be sparse, translation state is committed separately, and source/extraction/catalog drift fails closed without forcing target parity.
Design review found no unresolved scope or architecture issue. Completeness verification classified the headline behavior as implemented for Phases 1–2. Four code-review/fix rounds were required; both independent reviewers returned clean on the same Round 4 tree. After rebasing onto current
main, fresh architecture and reproduction reviewers again returned clean on the same integrated patch.The only implementation deviation was current-base integration: five newly landed feature-copy commits were explicitly classified as non-review provenance, six real new translations were retained as machine state, nine new byte-equal parity fillers were removed, extraction/state evidence was regenerated, and moved RPC schema messages were transferred to their new allowlist path.
App consistency and boundaries
The source-of-truth journey compared desktop renderer/web calls, Electron main-process calls, language selection, pseudo-localization, packaged locale loading, mobile CI boundaries, and macOS/Linux/Windows builds. Runtime loaders, persisted language selection, pseudo-localization, SSH/remote execution, relay behavior, and mobile RPC behavior are unchanged.
The PR fixes the workflow mismatch where feature PRs had to edit all target catalogs and where root localization gates were absent from PR CI. It intentionally defers translation-service selection, locale enablement thresholds, namespace/runtime-library changes, stale-entry omission from runtime bundles, global retranslation, and Phase 3+ bot/export workflow decisions. Generated
LocalizationKeyremains an evaluated Phase 2 output rather than a production-consumed contract. During Phases 1–2, English key deletion/rename still requires corresponding target cleanup.Translation preservation evidence
PRcorrection from#6749remains reviewed and byte-preserved.Explorercorrections from#6706remain reviewed and byte-preserved.ContinueCTA remains translatable: SpanishContinuarand Chinese继续remain machine translations; Japanese/Korean remain untranslated rather than falsely intentional-English.Performance
Performance audit result: clean. Product verification performs one source read/AST parse per file, reviewed-history collection remains exactly three Git processes over 271 locale-history commits, and the extraction matrix does not duplicate Ubuntu work. The PR adds no runtime polling, network calls, timers, listeners, startup awaits, persistent cache, SSH/WSL/mobile work, or render hot-path churn. Lazy target bundles shrink overall.
Tests
pnpm run typecheckpnpm run lintgit diff --check2 live terminals/3 active tasksfallbackMerge-confidence verdict: LAND on the exact pushed patch. Electron was not launched because macOS cannot honestly reach the only changed runtime UI surface and the architecture is otherwise build-time; testing an unchanged language picker would not prove the changed behavior. No screenshot is claimed. SSH and mobile are unaffected rather than positively exercised.
Local validation used Node 26.5.0 while the repository declares Node 24.
actionlintwas unavailable locally. Existing unrelated lint warnings remained non-failing. A broadpnpm testwas not run; focused localization/runtime tests, full typecheck, full lint, deterministic gates, two clean review lanes, and exact-tree merge-confidence validation passed.