feat: add Japanese (ja) localization across GUI, docs-site, and README#244
Conversation
|
✅ Target branch corrected This pull request now targets The |
Add gui/src/i18n/ja.ts with full Japanese translations for all TKey entries, register ja in shared.ts (Locale type, DICTS, LOCALES, detectInitial), update en.ts header comment, and extend the Locale-keyed Records in formatUptime.ts and QuotaBars.ts so the exhaustive switches/records stay compile-safe.
…nd key pages Add ja to astro.config.mjs (locales, inLanguage, sidebar group/item translations), add a full ja block to frontier-i18n.ts, and create the first ja content pages (index, contributing, installation) under docs-site/src/content/docs/ja/.
…oard, sub-agent-surface, codex-app-models, model-ordering, codex-integration)
…omponents The shared Landing.astro, Header.astro, and FrontierBoards.astro components only handled en/ko/zh-cn/ru and fell back to English for ja, so the Japanese landing page, header nav, and benchmark score column rendered in English even though the content pages passed locale="ja". - Landing.astro: extend the t() helper with a ja param and add Japanese strings to all 60 t() call sites (hero, subtitle, CTA, quickstart, bento, docs map, disclaimer). - Header.astro: same t() helper extension plus Japanese for the 19 nav labels. - FrontierBoards.astro: add "ja" to the locale prop union and the local SCORE_HEADER map (Score -> Japanese); FRONTIER_STRINGS.ja already existed. - gui/scripts/sync-locale-keys.mjs: include ja in the locale sync loop so new en.ts keys are backfilled into ja.ts too. Verified: bun run build succeeds (121 pages), ja landing/header/benchmark HTML now contains Japanese, en landing unchanged.
gui/src/status-codes.ts localized HTTP status messages for en/ko/zh/de/ru but omitted ja, so the Logs page showed English status explanations for Japanese users. - Add ja to the Locale union and normalizeLocale guard. - Add ja label+description for all 17 status codes (400-529) and both GENERIC_STATUS entries (client/server). Verified: tsc -b and eslint pass; statusCodeInfo(429,"ja") returns Japanese.
23f58e4 to
4d93e7e
Compare
|
Thank you for the comprehensive localization — this is wanted. A 4.7k-line cross-surface addition (GUI locale, docs-site, READMEs) needs its own dedicated review/QA cycle: docs-site build across locales, README cross-links, and GUI locale parity with en.ts. It's queued for that cycle rather than this batch. (For reference, the RU localization went through the same kind of dedicated pass.) |
|
The Japanese GUI/docs localization is valuable and the security review found no suspicious links, payloads, dependencies, workflows, or credential surface. The docs build passes. Current dev added new locale keys after this branch, so the GUI typecheck now needs a small locale-parity follow-up; I will merge the contribution and immediately add the missing-key fallback/update on dev. |
Add Japanese (ja) localization across all multilingual surfaces
opencodex is localized across the GUI, README, and docs-site, but Japanese (ja) was not present on every surface. This PR adds full Japanese support.
Scope
gui/src/i18n/ja.ts): ~960 keys, exact key parity withen.ts(0 missing, 0 extra). Registeredjainshared.ts(Localetype,DICTS,LOCALES,detectInitial).gui/src/status-codes.ts): Added ja labels+descriptions for all 17 status codes (400-529) plus both generic entries (client/server), and madenormalizeLocaleacceptja. The Logs page now shows Japanese status explanations.jalocale inastro.config.mjswith full sidebar translations, added a ja block tofrontier-i18n.ts(104 keys, matching en/ko/zh/ru), and added 24 content pages undersrc/content/docs/ja/mirroringko/(getting-started / guides / benchmarks / reference).t()helper with ajaparam inLanding.astro(60 call sites) andHeader.astro(19 call sites), and addedjato thelocaleprop union and localSCORE_HEADERmap inFrontierBoards.astro. Previously these components only handled en/ko/zh-cn/ru and fell back to English for ja, so the Japanese landing page, header nav, and benchmark score column rendered in English even though content pages passedlocale="ja".README.ja.mdand added a 日本語 link to the language list in every language README.gui/scripts/sync-locale-keys.mjs): Addedjato the locale sync loop so newen.tskeys are backfilled intoja.tstoo.Verification
tsc -b✅,eslint .✅,vite build✅bun run buildproduces 121 pages; ja = 24 pages (matches ko = 24)statusCodeInfo(429, "ja")returns Japanese at runtimeCommits
9 commits staged incrementally on
feat/add-japanese-i18n(GUI i18n → README → docs-site locale registration → content pages → component fixes → status codes).