Skip to content

Add an English / Chinese interface (V3 Milestone 4) - #21

Merged
CanYouTeachMeHowToCode merged 8 commits into
devfrom
feature/bilingual
Oct 3, 2026
Merged

CanYouTeachMeHowToCode merged 8 commits into
devfrom
feature/bilingual

Conversation

@CanYouTeachMeHowToCode

Copy link
Copy Markdown
Owner

Summary

  • Language switch in the nav bar. Logged-in users keep their choice on the account (users.preferred_language, PATCH /api/auth/me); visitors keep it in the browser, and the first visit follows the browser language.
  • Every interface string is in frontend/src/i18n/messages.ts. The Chinese table must have the same keys as the English one, which the TypeScript type enforces. Each language shows only its own text.
  • Chinese boss content for the 8 existing bosses: names, locations, phase names, move names, descriptions, telegraphs, counters and common mistakes.
  • Chinese move names record their source. wiki is used only when the full name appears on a Chinese wiki page, and a database constraint requires the page URL. Everything else is marked translation. 5 names come from BWIKI combat-art pages; the rest are translations.
  • When recording an attempt, each move shows its description as a hover tooltip, and the chosen move's description appears under the select (for phones, which have no hover).

Data rules

  • The seed sync rejects a move without a Chinese name, and any English text field without its Chinese version.
  • Chinese descriptions are translations of the sourced English text. The Chinese moveset shows one note saying so, rather than marking every move.
  • All Chinese content was reviewed manually.

Migrations

Two reviewed migrations that only add columns:

  • Chinese move names, with three check constraints
  • Chinese boss content and the user's language preference, with one check constraint

Autogenerate missed every check constraint, so they were added by hand. Existing rows get NULLs, and the next seed sync fills them in.

Testing

  • Backend: 157 tests, covering the bilingual seed rules, the database constraints and the language preference API
  • Frontend: 85 unit tests, covering English-only and Chinese-only rendering, the language provider (browser default, local storage, account preference) and the move description hint
  • Integration: 11 tests against the real backend, including saving the language preference and reading both languages

🤖 Generated with Claude Code

- moves.name_zh / name_zh_source ('wiki' | 'translation') /
  name_zh_source_url, with check constraints added by hand to the
  reviewed migration (autogenerate misses them)
- seed validation requires a Chinese name for every move; 102 existing
  moves named: 6 from BWIKI combat-art pages, 96 translations
- API returns the Chinese names; interim frontend display to be replaced
  by the language switch

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- language switch in the nav bar; saved on the account
  (users.preferred_language, PATCH /api/auth/me) or in the browser for
  visitors, defaulting to the browser language
- every interface string in both languages via a small in-house
  dictionary and t(); each language shows only its own text
- Chinese boss content for the 8 existing bosses: locations, phase names,
  and all 234 move text fields, translated from the sourced English;
  the seed requires a Chinese version for every English field
- Chinese moveset shows one note about translations; wiki-sourced names
  link to their page
- reviewed migration with a hand-added check constraint

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each move option carries its description as a hover tooltip, and the
chosen move's description is shown under the select (phones have no
hover). Both follow the interface language.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review file is committed temporarily so the review can continue on
another machine; it must be deleted before the pull request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Owl (Father)'s Shadowfall becomes the translation 巨型忍者落杀 rather
  than the combat art 秘传·巨型忍者落杀, since no authoritative source
  ties the two together; descriptions that mention it follow
- Corrupted Monk (Mibu Village) is 破戒僧; True Corrupted Monk stays
  宫内破戒僧
- regenerate the review file with these marked as decided

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Chinese content review is done, so the temporary review file is
removed and the bilingual interface is recorded as delivered in
CLAUDE.md, ROADMAP and both READMEs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@CanYouTeachMeHowToCode
CanYouTeachMeHowToCode merged commit 425a046 into dev Oct 3, 2026
4 checks passed
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