feat(i18n): add Japanese localization

RO
3d ago
+1956-4

Adds Japanese (ja) as an interface language. ja is already in LanguageSchema, and LanguageSelector.tsx already listed it as a commented-out entry, so this PR adds the catalogs and registers them.

Changes

  • src/i18n/locales/ja/*.json: Japanese catalogs for common, settings, chat, home and errors (1,761 strings), in sync with the current en keys on main.
  • src/i18n/index.ts: registers the ja resources.
  • src/components/LanguageSelector.tsx: lists "日本語" and removes the commented-out line for it.
  • src/i18n/test_gate_locales.test.ts: covers ja.
  • rules/i18n.md and PRODUCT.md: list ja with the other locales.

The open Italian PR (#5059) edits the same lines in index.ts, LanguageSelector.tsx, test_gate_locales.test.ts and the two docs. If it is merged first, I will rebase this one.

How it was translated

  • Terms follow common Japanese software usage: アプリ (app), チャット (chat), プロンプト (prompt), プロバイダー (provider), APIキー (API key), ログイン (sign in), デプロイ (deploy), コミット (commit).
  • Product, model and feature names that the zh-CN catalog keeps in Latin letters (Dyad Pro, Supabase, Neon, Turbo Edits) stay as they are. Smart Context is written スマートコンテキスト, since zh-CN translates it too.
  • A few messages point to settings that the UI still shows in English (Experiments, Build and Agent Permissions, Protect Neon database branches, Keep extra Supabase edge functions). Those names are quoted in English inside the Japanese text so they match the screen.
  • Messages use the polite form. Buttons and labels are short.
  • Japanese has one plural form, so the _one and _other keys carry the same text.
  • Code-like placeholders (paths, URLs, branch names, resource IDs) are left in English.
  • Strings that the UI joins with other text were checked against the components that render them.

Checks

A script compared every value with en: same keys in the same order, the same {{placeholders}}, the same number of line breaks, and no empty values. The files use the same 2-space layout as the other catalogs. I have not run npm test, npm run ts, prettier or oxlint locally, so CI will be the first run.

This was made with AI (Claude).

🤖 Generated with Claude Code


Devin Review