Skip to content

Add Japanese and Spanish locales - #1

Open
jakinchan wants to merge 3 commits into
MkFastHQ:mainfrom
jakinchan:feat/ja-es-locales
Open

jakinchan wants to merge 3 commits into
MkFastHQ:mainfrom
jakinchan:feat/ja-es-locales

Conversation

@jakinchan

Copy link
Copy Markdown

Summary

  • Extends the site from en/zh to en/zh/ja/es, following the existing zh implementation pattern.
  • Adds project.inlang/messages/ja.json and es.json with full translations of all 80 message keys.
  • Adds /ja and /es routes (src/routes/ja.tsx, es.tsx), mirroring zh.tsx.
  • Generalizes locale-aware code that was previously hardcoded to two locales:
    • src/lib/locale.ts: AppLocale type, localeMeta, and localizedPath now cover all four locales.
    • src/routes/__root.tsx: locale detection and the 404 "back home" link are locale-generic.
    • src/lib/seo.ts: hreflang alternate links are generated for all locales instead of being hardcoded.
    • src/routes/sitemap[.]xml.ts: sitemap now emits a <url> entry with alternates for every locale.
    • src/components/layout/language-switcher.tsx: switcher now lists all four languages.
    • scripts/check-locale-keys.ts: key-parity check now validates all locale files against the base locale.
  • Adds ARCHITECTURE.md with Mermaid UML diagrams (component, class, sequence) documenting the site's route and component structure.
  • Design spec committed at docs/superpowers/specs/2026-08-23-add-ja-es-locales-design.md.

Test plan

  • pnpm exec tsc --noEmit — passes
  • pnpm exec vitest run — 5 tests pass
  • pnpm exec tsx scripts/check-locale-keys.ts — 80 keys parity across en/zh/ja/es
  • pnpm build — client and server bundles build successfully, ja/es chunks generated
  • Manually verified in-browser: /ja and /es render fully translated pages, language switcher exposes all four languages with correct hrefs, /sitemap.xml emits correct per-locale alternate links

Note: pnpm check's Biome formatting step fails repo-wide in this environment due to core.autocrlf=true converting LF to CRLF on checkout (reproducible on files untouched by this PR, e.g. src/lib/utils.ts). This is a pre-existing environment issue unrelated to this change.

Language switcher only exposes en/zh; adding ja and es following the
existing zh implementation pattern.
Extend the site to en/zh/ja/es. Adds ja.json/es.json translations
following the existing zh pattern, new /ja and /es routes, and
generalizes locale-aware logic (routing, hreflang alternates, sitemap,
language switcher, key-parity check) that was previously hardcoded to
two locales.

Also updates ARCHITECTURE.md with UML diagrams documenting the site's
route, component, and class structure.
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