Skip to content

feat: add Japanese localization with react-i18next#249

Open
atani wants to merge 3 commits intoavihaymenahem:mainfrom
atani:feat/i18n-japanese
Open

feat: add Japanese localization with react-i18next#249
atani wants to merge 3 commits intoavihaymenahem:mainfrom
atani:feat/i18n-japanese

Conversation

@atani
Copy link
Copy Markdown

@atani atani commented Apr 4, 2026

Summary

This PR adds full Japanese localization support to Velo using react-i18next.

  • Integrated react-i18next with automatic browser language detection and a manual language switcher in Settings
  • Extracted 1619 translation keys across 80+ components into en.json and ja.json
  • Translated help content, settings, email actions, AI features, calendar, and error messages
  • Added i18n key parity test to keep en.json and ja.json in sync
  • Fixed remaining hardcoded English strings found during review (title attributes, placeholders, error boundary text)

Test plan

  • npm run test passes (134 files, 1566 tests)
  • npx tsc --noEmit passes with no type errors
  • npx vitest run src/i18n/i18n.test.ts confirms en/ja key parity
  • Set browser language to Japanese and confirm UI renders in Japanese
  • Switch language via Settings > Language dropdown and confirm UI updates
  • Confirm fallback to English for any missing keys
  • Spot-check translated strings in Sidebar, Composer, Settings, Calendar, and Help pages

atani added 3 commits April 3, 2026 17:57
- Add i18next and react-i18next for internationalization
- Create English (en.json) and Japanese (ja.json) translation files
  with 700+ translation keys covering all UI strings
- Refactor 65+ components to use useTranslation() hook
- Add language switcher in Settings > General (English / Japanese)
- Persist language preference in SQLite, restore on startup
- Default language auto-detected from OS locale
- Refactor constants/shortcuts.ts to getShortcuts(t) factory
- Add nameKey to color themes for translatable theme names
- Initialize i18n in test setup with English translations
Round 1-3 review-fix loop results:

- Refactor 14 additional components: ContextMenuPortal, CalDavSettings,
  AddCalDavAccount, ContactSidebar, SubscriptionManager, SmartLabelEditor,
  SmartFolderEditor, QuickStepEditor, TemplateEditor, ContactEditor,
  CalendarReauthBanner, EventDetailModal, ConfirmDialog, InputDialog, etc.
- Translate entire help content system (1300+ lines, 14 categories, ~50 cards)
  via getHelpCategories(t) factory function
- Add App.tsx sync status translations (syncing/complete/failed)
- Fix SettingsPage.tsx remaining strings (categories, sidebar, DAY_NAMES)
- Fix AddImapAccount.tsx placeholder strings
- Fix networkErrors.ts with i18n.t() for non-component context
- Fix App.tsx stale closure: use i18n.t() instead of hook t in useEffect
- Add en/ja key parity test (1619 keys, perfect match)
- Add getShortcuts(t) translated output tests
- Add initImmediate: false for synchronous test setup
Replace hardcoded title attributes, placeholders, and text content with
t() calls in RawMessageModal, ThreadCard, InlineReply, EmailRenderer,
DateTimePickerDialog, ErrorBoundary, and SmartFolderEditor. Add 24 new
translation keys to both en.json and ja.json.
@atani atani requested a review from avihaymenahem as a code owner April 4, 2026 02:34
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