Repository navigation
fix(i18n): extract translateSearchKeyword calls so settings-search keywords reach en.json - #18040
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe localization extractor and catalog verifier now recognize Merge Risk: ⚪ Minimal · up to This change makes settings-search keyword references available to localization extraction and adds the corresponding English catalog entries. No current merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3 files. (1 skipped: 1 unsupported.) Full details: Description checkExplanation The description is mostly complete. It explains the problem, changes, rationale, linked issue, test results, and AI usage. It omits several template sections, including explicit Visual Proof N/A, Review, Agent skill upstream boundary, Notes, and the checklist, but these omissions do not prevent understanding the focused change. 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 |
57aa803 to
45cb99e
Compare
There was a problem hiding this comment.
Important
This PR cannot merge as-is: it leaves the verify:localization-extraction CI step red, and it does not actually make the missing keys reach en.json.
Reviewed changes
config/i18next.config.ts— addstranslateSearchKeywordto the i18next-cliextract.functionslist so the extractor surfaces keys only referenced through the settings-search wrapper.
⚠️ The catalog sync path still cannot see these keys
Adding translateSearchKeyword to extract.functions only teaches the i18next-cli extractor about the wrapper. The command that actually writes missing keys into en.json — pnpm run sync:localization-catalog, i.e. config/scripts/verify-localization-catalog.mjs --fix — uses its own AST-based collector with a separate hardcoded set, LOCALIZATION_FUNCTION_NAMES = new Set(['t', 'translate', 'translateMain']) at config/scripts/verify-localization-catalog.mjs:14. That set does not include translateSearchKeyword, so the --fix path will not collect any of the 155 missing settings-search keys and will never add them to en.json.
The PR body's claim that "the next catalog sync writes them into en.json" is therefore not met by this change alone. The two function-name lists must be updated together, or the keys stay invisible to the one tool that bootstraps en.json.
Technical details
# Sync path misses translateSearchKeyword keys
## Affected sites
- config/scripts/verify-localization-catalog.mjs:14 — `LOCALIZATION_FUNCTION_NAMES` lacks `translateSearchKeyword`, so `collectLocalizationKeyReferences` (line 90) ignores every `translateSearchKeyword(key, fallback)` call and `--fix` never bootstraps them.
- config/scripts/verify-localization-catalog.test.mjs — fixtures use only `translate`; no test exercises the wrapper, so this gap is not covered.
## Required outcome
- Add `translateSearchKeyword` to `LOCALIZATION_FUNCTION_NAMES` in `verify-localization-catalog.mjs` so `sync:localization-catalog` collects and bootstraps the wrapper's string-literal keys.
- Regenerate `src/renderer/src/i18n/locales/en.json` in this same PR so both `verify:localization-catalog` and `verify:localization-extraction` pass on the branch.
## Open questions for the human
- Do the `englishOnly` keywords (brand/acronym aliases) belong in `en.json` at all, given their fallback is meant to stay exact English? They will still be extracted as first-arg keys.DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
ℹ️ No new code changes since the prior review — the head moved from
57aa803to45cb99e, but the diff is byte-identical.
Reviewed changes
- Commit message only — the commit body was expanded with the "155 of 1 090 keys" summary and the
verify-localization-extractionblind-spot note. The one-lineextract.functionschange is unchanged.
The two findings from the prior review still stand and are unresolved: the verify:localization-extraction CI step will stay red until en.json is regenerated in this PR, and LOCALIZATION_FUNCTION_NAMES in config/scripts/verify-localization-catalog.mjs:14 still needs translateSearchKeyword added before sync:localization-catalog can bootstrap the 155 missing keys.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
|
Both findings were right — thanks. Addressed in 311aafb4:
Checked locally: On the |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Catalog sync now collects
translateSearchKeyword— added the wrapper toLOCALIZATION_FUNCTION_NAMESinconfig/scripts/verify-localization-catalog.mjs, sosync:localization-catalogbootstraps the 155 previously-invisible keys. - Regenerated
en.json— 155 settings-search keys added (0 changed, 0 removed) viasync:localization-catalog, resolving theverify:localization-extractionCI break. - Added test coverage — a new case verifies keys referenced only through
translateSearchKeywordare bootstrapped intoen.json.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Settings search keywords are declared through translateSearchKeyword(key, fallback), but extract.functions only listed t, translate and translateMain. Keys added through the wrapper never reached en.json: on v1.4.194 that is 155 of the 1 090 keys it is called with, missing from every locale. verify-localization-extraction cannot see it — a key absent from both the extraction and en.json is not a mismatch. Author: @imgusev with Claude
The extractor and the catalog sync keep separate function lists, and adding the wrapper to only one of them leaves the keys unreachable for the tool that writes en.json and turns verify:localization-extraction red on the branch. - verify-localization-catalog.mjs: add translateSearchKeyword to LOCALIZATION_FUNCTION_NAMES so `sync:localization-catalog` collects the wrapper's keys - en.json: regenerated with `--fix` — 154 keys added, none changed or removed - test: bootstrap of a key referenced only through the wrapper Author: @imgusev with Claude
311aafb to
0631764
Compare
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Rebased onto current |
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
- Rebased onto newer
main—agentDashboard.dashboardhad already landed onmain, so theen.jsonregeneration now adds 154 keys rather than 155 and no longer touches that key (it appears as context with a trailing-comma change). - Split into two commits — the extractor change (
i18next.config.ts) and the catalog sync (LOCALIZATION_FUNCTION_NAMES+en.json+ test) are now separate commits.
The tooling logic is byte-for-byte equivalent to the previously approved head; only the catalog delta shifted because of the dashboard key moving to main. Ran verify-localization-catalog.test.mjs (8 passed) and confirmed en.json is valid JSON.
DeepSeek Pro (free via Pullfrog for OSS) | 𝕏
Каталог: 13 910 из 14 099 строк (98%). Приложение добавило 121 ключ, убрало два и переписало текст у семи — переведены все новые. Крупное новое: передача сессии между чатом и терминалом агента, фоновые задачи во встроенном чате, дорожная карта проектов GitHub, экран восстановления после сбоя окна, разделение чата в быстрых действиях, подсказки тем на онбординге, французский в списке языков. Добор ключей из app.asar стал нулевым: с 1.4.198 ключи поиска по настройкам приходят через en.json после слияния stablyai/orca#18040. Разбор бандла оставлен как страховка, README и докстринг extract.py переписаны под это. Author: @imgusev with Claude

ELI5
Settings search keywords are declared through
translateSearchKeyword(key, fallback), but neither the i18next extractor nor the catalog sync knew about that wrapper. So keys added through it never reacheden.json, and no locale — built-in or language pack — could translate them.What Changed
config/i18next.config.ts— addedtranslateSearchKeywordtoextract.functions, soverify:localization-extractionsees the wrapper's keys.config/scripts/verify-localization-catalog.mjs— added it toLOCALIZATION_FUNCTION_NAMES, sosync:localization-catalogcollects and bootstraps them. The two lists have to move together: the first one alone turnsverify:localization-extractionred, because the extractor then finds keys the sync tool still cannot write.src/renderer/src/i18n/locales/en.json— regenerated withpnpm run sync:localization-catalog: 154 keys added, 0 changed, 0 removed (155 at the time of opening;agentDashboard.dashboardhas since landed inmain).config/scripts/verify-localization-catalog.test.mjs— a test that bootstraps a key referenced only through the wrapper.The wrapper's signature is
(key, fallback, options?), the same shape astranslate, so both tools read it the same way they already readtranslateMain.Why
Measured against
v1.4.194:translateSearchKeywordis called with 1 090 distinct keys. 935 were inen.json; 155 were not, and were therefore missing fromko,ja,zhandesas well. All of them are settings-search keywords (auto.components.settings.*.search.*) plus thekeyword*entries underorcaAccountandartifacts.src/renderer/src/components/settings/settings-search-keywords.ts) callstranslate(key, fallback)internally, so the keys are fully localizable at runtime — they were just invisible to both tools.verify-localization-extraction.mjscould not catch this onmain: it compares the extracted catalog withen.json, and a key missing from both sides is not a mismatch. The 935 keys that were inen.jsonshowed up as statically unreferenced orphans for the same reason.A concrete example of what packs have to do in the meantime, and why it is fragile: mine supplements
en.jsonby scanning the shipped bundle for those key/fallback pairs. Between 1.4.194 and 1.4.195 the bundle's minification changed —translatebecame a one-letter alias and the strings moved to template literals — and the scan silently returned nothing. Nothing in Orca broke; the pack just lost the 152 keys with no error to point at. Keys that live inen.jsondo not have that failure mode.Verification
verify:localization-catalog— exit 0verify:localization-extraction— exit 0 (withen.jsonreverted it fails on the 155 keys, as expected)verify-localization-catalog.test.mjs— 8 passed, including the new caseOn
englishOnlykeywords11 of the 155 keys are called with
englishOnly: true, sotranslate()is never reached for them and theen.jsonentries are inert. They still land in the catalog because both tools key off the first argument, same as any other call. Harmless, but if you would rather keep them out, anenglishOnlycheck incollectLocalizationKeyReferenceswould do it — happy to add that here or in a follow-up.Linked Issue
Part of #17913 — the third category discussed there.
Author: @imgusev with Claude