Conversation
added 4 commits
September 15, 2026 13:41
Replace the hand-maintained resources object in i18n.ts with an import.meta.glob-based scan of locales/<locale>/<namespace>.json, so adding a new language only requires dropping in resource files. Locale keys are sorted deterministically to avoid depending on filesystem enumeration order (multi-candidate normalization reads Object.keys(resources)).
Add 7 new extension UI locales (221 keys each: common + extension namespaces), picked up automatically by the import.meta.glob-based registration in i18n.ts. - zh-TW: Traditional Chinese, disambiguated from zh-CN by script/region in the existing locale normalizer. - ja-JP, fr-FR, it-IT, es-ES, de-DE, pt-BR: new language families. Update locale-resolution.test.ts and i18n.test.ts expectations that hardcoded the previous shipped-language set (zh-Hant/zh-TW/zh-HK/zh-MO now resolve to zh-TW instead of falling back to zh-CN; ja/fr/de/it/es/pt are no longer in the unshipped-fallback examples). ko-KR is unchanged. Update language lists in packages/i18n/README.md, README.md and README.zh-CN.md. Verified: i18n test (64/64), ext:test (1598/1598), extension compile, ext:build, biome check — all green.
- ja-JP: extensionVersion/protocolVersion were left in English,
inconsistent with the already-translated extensionProtocol/
daemonProtocol in the same namespace.
- de-DE: same extensionVersion/protocolVersion omission; also
hover was mistranslated as "Überfahren" (run over / collide),
not the German UI term for mouse hover — changed to "Hover".
- it-IT: focus was translated as "Metti a fuoco" (camera focus),
inconsistent with the adjacent blur ("Rimuovi focus", which
correctly keeps focus as a loanword) — changed to "Attiva focus".
Verified: i18n test (64/64), ext:test (1598/1598), extension compile,
biome check — all green.
Upstream main gained a remote/authenticated browser connection feature (PR Tencent#227, merged after this branch was created) that added 36 new extension.json keys (popup.connection*, popup.remote*) and reworded two existing keys (daemonPortLabel, daemonPortInfoLabel) in en-US, zh-CN and ko-KR. After rebasing this branch onto the updated main, the 7 new locales added here were missing those same keys, which broke the i18n parity test in CI ("Frontend lint, typecheck, tests, build" failing on de-DE). Translate the 38 changed/added keys for zh-TW, ja-JP, fr-FR, it-IT, es-ES, de-DE and pt-BR, using the already-shipped zh-CN/ko-KR translations as terminology reference. Verified: i18n test (64/64), ext:test (1658/1658), extension compile, ext:build, biome check — all green.
iAstro
force-pushed
the
feat/i18n-multi-language
branch
from
September 15, 2026 05:53
d04017c to
47cf368
Compare
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
Adds 7 new extension UI locales and makes locale registration automatic, so shipping a future language no longer requires touching
i18n.ts.Changes
resourcesobject ini18n.tswith animport.meta.globscan oflocales/<locale>/<namespace>.json. Locale keys are sorted deterministically since multi-candidate normalization readsObject.keys(resources).zh-TW,ja-JP,fr-FR,it-IT,es-ES,de-DE,pt-BR(221 keys each,common+extensionnamespaces).zh-TWis disambiguated fromzh-CNby the existing script/region normalizer.ko-KRis unchanged.locale-resolution.test.ts/i18n.test.tsexpectations that hardcoded the previous shipped-language set.packages/i18n/README.md,README.md,README.zh-CN.md.Testing
pnpm --filter @browser-skill/i18n test— 64/64pnpm ext:test— 1598/1598pnpm --filter @browser-skill/extension compile— cleanpnpm ext:build— success (1.83MB)pnpm exec biome check .— cleanReview notes
Translations were machine-drafted then human-reviewed; two mistranslations caught in review were fixed before this PR (de-DE
hover, it-ITfocus) along with two omitted strings (ja-JP/de-DEextensionVersion/protocolVersion).