Skip to content

feat(i18n): add pt-BR, ja, ko and es locales - #546

Open
Blankll wants to merge 3 commits into
masterfrom
feat/i18n-ptbr-ja-ko-es
Open

Blankll wants to merge 3 commits into
masterfrom
feat/i18n-ptbr-ja-ko-es

Conversation

@Blankll

@Blankll Blankll commented Nov 13, 2026

Copy link
Copy Markdown
Member

Closes the dockit portion of wentsen/geekfun#79

What

Adds pt-BR, Japanese, Korean, and Spanish to DocKit, with full translations of all UI strings.

  • src/lang/: four new catalogs (ptBR, jaJP, koKR, esES, 1789 keys each), registered in the i18n setup with system-language detection extended (pt* / ja* / ko* / es* prefixes; zh-TW/HK/MO/Hant unchanged). Missing keys now fall back to enUS because the config gained an explicit fallbackLocale.
  • Settings picker: the four languages appear under Settings → Basic → Language. This also fixes an old bug in the picker — any non-Chinese selection was previously mapped back to English, so choosing a new locale used to display English regardless. AUTO now delegates to the same detection the startup path uses.
  • getDocLanguage() still returns 'en' for the four new locales, since docs and agent prompts ship only in English and Chinese.
  • tests/i18nParity.test.ts: every locale file must carry exactly the enUS key set; CI now fails on drift instead of silently rendering English at runtime.
  • docs/I18N.md: documents the setup and the steps to contribute another language.
  • README: four new translations plus the expanded language navigation line.

Verification

  • npx jest tests/i18nParity.test.ts — 6 locales, all key sets identical to enUS (1789 keys)
  • vue-tsc --noEmit clean
  • Existing tests unaffected

- new src/lang catalogs with full translations (1789 keys each, parity-tested)
- register the four locales in the i18n setup and extend system-language detection
- fix the settings picker mapping any non-Chinese selection back to English
- add a key-parity test guarding every locale against the enUS key set
- document the i18n setup and the add-a-language workflow in docs/I18N.md
- add README translations and expand the language navigation line
@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.26087% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.26%. Comparing base (492b4f7) to head (768c541).

Files with missing lines Patch % Lines
src/lang/index.ts 70.58% 0 Missing and 5 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #546      +/-   ##
==========================================
+ Coverage   72.21%   72.26%   +0.04%     
==========================================
  Files         171      174       +3     
  Lines       29769    29701      -68     
  Branches     1509     1514       +5     
==========================================
- Hits        21498    21463      -35     
+ Misses       7810     7772      -38     
- Partials      461      466       +5     
Files with missing lines Coverage Δ
src/lang/enUS.ts 100.00% <ø> (ø)
src/lang/esES.ts 100.00% <100.00%> (ø)
src/lang/jaJP.ts 100.00% <ø> (ø)
src/lang/koKR.ts 100.00% <ø> (ø)
src/lang/ptBR.ts 100.00% <100.00%> (ø)
src/lang/zhCN.ts 100.00% <ø> (ø)
src/lang/zhTW.ts 100.00% <ø> (ø)
src/store/appStore.ts 51.55% <100.00%> (+0.76%) ⬆️
src/lang/index.ts 86.84% <70.58%> (-13.16%) ⬇️

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant