Skip to content

feat(i18n): add frontend internationalization with browser language d… - #385

Open
kirinsir wants to merge 1 commit into
eugenioenko:mainfrom
kirinsir:feat/frontend-i18n-only
Open

feat(i18n): add frontend internationalization with browser language d…#385
kirinsir wants to merge 1 commit into
eugenioenko:mainfrom
kirinsir:feat/frontend-i18n-only

Conversation

@kirinsir

Copy link
Copy Markdown

…etection

Frontend Changes Only

Complete i18n implementation for both admin-ui and account-ui:

  • React i18next integration with JSON locale files
  • LanguageSwitcher component for manual language switching
  • Browser language detection with fallback to English
  • 613 keys in admin-ui, 219 keys in account-ui

Language Detection Logic

  1. Priority 1: localStorage saved preference
  2. Priority 2: Browser language (navigator.language)
    • Browser language starting with 'zh' → Chinese
    • All other languages → English
  3. Fallback: English (project is English-first)

Files Modified

admin-ui/ (28 files, 613 keys)

  • All components converted to use i18n hooks
  • New: i18n/ directory with en.json, zh.json
  • New: LanguageSwitcher.tsx component
  • package.json: added i18next dependencies

account-ui/ (24 files, 219 keys)

  • All components converted to use i18n hooks
  • New: i18n/ directory with en.json, zh.json
  • New: LanguageSwitcher.tsx component
  • package.json: added i18next dependencies

No Server-Side Changes

This PR contains only frontend changes. No Go code, HTML templates, or OAuth2 error messages were modified.

…etection

## Frontend Changes Only

Complete i18n implementation for both admin-ui and account-ui:
- React i18next integration with JSON locale files
- LanguageSwitcher component for manual language switching
- Browser language detection with fallback to English
- 613 keys in admin-ui, 219 keys in account-ui

## Language Detection Logic

1. Priority 1: localStorage saved preference
2. Priority 2: Browser language (navigator.language)
   - Browser language starting with 'zh' → Chinese
   - All other languages → English
3. Fallback: English (project is English-first)

## Files Modified

**admin-ui/** (28 files, 613 keys)
- All components converted to use i18n hooks
- New: i18n/ directory with en.json, zh.json
- New: LanguageSwitcher.tsx component
- package.json: added i18next dependencies

**account-ui/** (24 files, 219 keys)
- All components converted to use i18n hooks
- New: i18n/ directory with en.json, zh.json
- New: LanguageSwitcher.tsx component
- package.json: added i18next dependencies

## No Server-Side Changes

This PR contains only frontend changes. No Go code, HTML templates, or OAuth2 error messages were modified.
@kirinsir
kirinsir requested a review from eugenioenko as a code owner June 29, 2026 03:15
@eugenioenko

Copy link
Copy Markdown
Owner

Hi @kirinsir thank you for putting this together. It's looking really good. Before we can merge it does need a few fixes.
The main blocking one is that there are some translations in *.ts files like utils.ts or passkeys.ts
All translations should be only in the locale files and there rest use the i18n keys or english.

Can you make another pass an make sure all the translations are only in the locales?
Thank you!

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.

2 participants