Skip to content

feat(i18n): multi-language support with header language switcher - #163

Open
Chenghao999 wants to merge 1 commit into
pbogre:mainfrom
Chenghao999:feat/i18n
Open

feat(i18n): multi-language support with header language switcher#163
Chenghao999 wants to merge 1 commit into
pbogre:mainfrom
Chenghao999:feat/i18n

Conversation

@Chenghao999

Copy link
Copy Markdown

Summary

Add full internationalization using react-i18next:

  • Language switcher in the top-right corner of the header.
  • Fully translated locales: English, Simplified Chinese, Traditional Chinese (Taiwan). Japanese, Korean, French, German and Spanish are selectable placeholders that currently fall back to English, ready for future contributors.
  • Docker-configurable default language via the DEFAULT_LANGUAGE environment variable, served from GET /config.
  • Language preference persists in localStorage; browser locale is used when no preference is set.
  • All pages, navigation, tables, charts and shared UI components are translated.

Also:

  • Add .gitignore entries for pnpm-generated artifacts (.pnpm-store/, pnpm-lock.yaml, .pytest_cache/).
  • Add pnpm-workspace.yaml to allow the esbuild postinstall under pnpm 11.

Testing

  • New pytest suite (server/tests/): locale key parity between en/zh-CN/zh-TW, empty placeholder locales, and DEFAULT_LANGUAGE in GET /config.
  • tsc --noEmit and vite build pass.
  • Live server smoke test passed: login, /config, /api/flights, and the built bundle contains all language strings.

AI-generated

This branch was developed with AI assistance (Codex): the i18n infrastructure and locale files, the language switcher, the translation pass across pages and components, the DEFAULT_LANGUAGE wiring, and the test suite were generated by AI.

Add full internationalization using react-i18next:
- Language switcher in the top-right corner of the header
- Fully translated locales: English, Simplified Chinese, Traditional
  Chinese (Taiwan); Japanese, Korean, French, German, Spanish are
  selectable placeholders that fall back to English
- Docker-configurable default language via the DEFAULT_LANGUAGE
  environment variable, served from GET /config
- Language preference persists in localStorage; browser locale is used
  when no preference is set
- All pages, navigation, tables, charts and shared UI components are
  translated

Also:
- Add .gitignore entries for pnpm-generated artifacts
  (.pnpm-store/, pnpm-lock.yaml, .pytest_cache/)
- Add pnpm-workspace.yaml to allow the esbuild postinstall under pnpm 11

Testing:
- New pytest suite (server/tests): locale key parity between en/zh-CN/
  zh-TW, placeholder locales, and DEFAULT_LANGUAGE in GET /config
- tsc --noEmit and vite build pass; live server smoke test passed
  (login, /config, /api/flights)

AI-generated parts:
- i18n infrastructure and locale files (client/i18n.ts, client/locales/)
- language switcher component and the translation pass across pages and
  components
- DEFAULT_LANGUAGE wiring (server/environment.py, server/main.py,
  client/api.ts, Dockerfile, README)
- locale/config test suite (server/tests/)
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