Skip to content

feat: add Japanese (ja) localization across GUI, docs-site, and README#244

Merged
Ingwannu merged 9 commits into
lidge-jun:devfrom
Lqm1:feat/add-japanese-i18n
Jul 22, 2026
Merged

feat: add Japanese (ja) localization across GUI, docs-site, and README#244
Ingwannu merged 9 commits into
lidge-jun:devfrom
Lqm1:feat/add-japanese-i18n

Conversation

@Lqm1

@Lqm1 Lqm1 commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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 i18n (gui/src/i18n/ja.ts): ~960 keys, exact key parity with en.ts (0 missing, 0 extra). Registered ja in shared.ts (Locale type, DICTS, LOCALES, detectInitial).
  • GUI status codes (gui/src/status-codes.ts): Added ja labels+descriptions for all 17 status codes (400-529) plus both generic entries (client/server), and made normalizeLocale accept ja. The Logs page now shows Japanese status explanations.
  • docs-site: Registered the ja locale in astro.config.mjs with full sidebar translations, added a ja block to frontier-i18n.ts (104 keys, matching en/ko/zh/ru), and added 24 content pages under src/content/docs/ja/ mirroring ko/ (getting-started / guides / benchmarks / reference).
  • Shared components: Extended the t() helper with a ja param in Landing.astro (60 call sites) and Header.astro (19 call sites), and added ja to the locale prop union and local SCORE_HEADER map in FrontierBoards.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 passed locale="ja".
  • README: Created README.ja.md and added a 日本語 link to the language list in every language README.
  • Maintenance script (gui/scripts/sync-locale-keys.mjs): Added ja to the locale sync loop so new en.ts keys are backfilled into ja.ts too.

Verification

  • GUI: tsc -b ✅, eslint . ✅, vite build
  • docs-site: bun run build produces 121 pages; ja = 24 pages (matches ko = 24)
  • Confirmed Japanese text in rendered HTML (landing H1/subtitle/nav/CTA, header nav, benchmark score column)
  • English landing page unchanged (no ja leak)
  • statusCodeInfo(429, "ja") returns Japanese at runtime
  • Exhaustive sweep: 0 locale switches referencing ko/ru without ja

Commits

9 commits staged incrementally on feat/add-japanese-i18n (GUI i18n → README → docs-site locale registration → content pages → component fixes → status codes).

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

Target branch corrected

This pull request now targets dev.

The [WRONG BRANCH] title prefix has been removed. The pull request has been marked ready for review again.

@github-actions github-actions Bot changed the title feat: add Japanese (ja) localization across GUI, docs-site, and README [WRONG BRANCH] feat: add Japanese (ja) localization across GUI, docs-site, and README Jul 22, 2026
@github-actions
github-actions Bot marked this pull request as draft July 22, 2026 02:54
@Lqm1
Lqm1 changed the base branch from main to dev July 22, 2026 02:54
@github-actions github-actions Bot changed the title [WRONG BRANCH] feat: add Japanese (ja) localization across GUI, docs-site, and README feat: add Japanese (ja) localization across GUI, docs-site, and README Jul 22, 2026
@github-actions
github-actions Bot marked this pull request as ready for review July 22, 2026 02:55
@Lqm1 Lqm1 closed this Jul 22, 2026
@Lqm1
Lqm1 deleted the feat/add-japanese-i18n branch July 22, 2026 02:55
@Lqm1
Lqm1 restored the feat/add-japanese-i18n branch July 22, 2026 02:55
@Lqm1 Lqm1 reopened this Jul 22, 2026
Lqm1 added 9 commits July 22, 2026 11:57
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.
@Lqm1
Lqm1 force-pushed the feat/add-japanese-i18n branch from 23f58e4 to 4d93e7e Compare July 22, 2026 03:00
@lidge-jun

Copy link
Copy Markdown
Owner

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.)

Copy link
Copy Markdown
Owner

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.

@Ingwannu
Ingwannu merged commit a1fdbdc into lidge-jun:dev Jul 22, 2026
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.

3 participants