---
id: w5/m3/t006
title: Seed a second language (zh) + update docs/CLAUDE.md
worker: worker5
status: done
estimate: 45m
depends_on: [w5/m3/t004, w5/m3/t005]
---

## Objective

Prove the system is genuinely multi-language by shipping a second locale end-to-end
(`zh`), and update the dashboard docs to reflect that i18n now exists and how to
extend it. Ends the milestone with a demonstrably working switch, not just an
`en`-only framework.

## Context

- Every namespace with an `en.ts` (from t004) gets a sibling `zh.ts` with the
  same keys translated; register `zh` in `SUPPORTED_LANGUAGES` / `LANGUAGE_NAMES`
  / the i18next resources (the reference's "Adding New Languages" steps in its
  `docs/i18n.md`).
- Ory Elements already supports `zh` in its bundled translations (t005 just wires
  the locale through) — confirm the Ory forms follow `zh` too.
- `dashboard/CLAUDE.md` currently states **"No i18n — this scaffold ships
  hardcoded English strings."** That is now false and must be replaced with the
  actual convention (feature-based `locales/`, namespaced keys, `useTranslations`,
  SSR detection, how to add a language, Ory locale wiring). Consider a short
  `dashboard/docs/i18n.md` mirroring the reference's structure, and index it.

## Steps

1. Add `zh.ts` to each `locales/` dir created in t004 (`common`, `auth`, `metrics`).
2. Register `zh` in `src/i18n/config.ts` + resources + `src/i18n/index.ts`.
3. Confirm the switcher (t003) offers `中文` and switching flips both app strings
   and Ory forms; confirm SSR with `i18nextLng=zh` cookie shows Chinese with no
   hydration warning.
4. Rewrite the `dashboard/CLAUDE.md` "No i18n" note; add/adjust docs and run
   `npx prettier@3.4.2 --write "**/*.md"`.

## Files

- `dashboard/src/{common,features/auth,features/metrics}/locales/zh.ts`
- `dashboard/src/i18n/{config.ts,index.ts}`
- `dashboard/CLAUDE.md`
- (optional) `dashboard/docs/i18n.md` + doc index

## Acceptance criteria

- [ ] The app + the Ory auth forms render fully in `zh` when selected; `en`
      remains the default.
- [ ] No key is present in `en` but missing in `zh` for the shipped namespaces.
- [ ] `dashboard/CLAUDE.md` documents the i18n convention (no stale "No i18n" line);
      markdown is prettier-clean.
- [ ] `yarn typecheck` / `yarn lint` / `yarn test` pass.

## Out of scope

- Adding languages beyond `en` + `zh` (documented mechanical step, not committed here).
</content>
