Skip to content

Add internationalization - #232

Merged
jobbykings merged 1 commit into
Epondia:mainfrom
Chigybillionz:internationalisation
Jul 24, 2026
Merged

Add internationalization#232
jobbykings merged 1 commit into
Epondia:mainfrom
Chigybillionz:internationalisation

Conversation

@Chigybillionz

Copy link
Copy Markdown
Contributor

Close #198

Summary of the issue
The project lacked full internationalization (i18n) support, making it inaccessible to non-English speakers. The task required configuring language detection, extracting user-facing strings, updating the language switcher, supporting RTL layouts for Arabic and Hebrew, providing initial translations, and documenting the process.

Root cause
The application was primarily rendering hard-coded English text in components like the LanguageSwitcher. Additionally, Next.js locale detection was explicitly disabled (localeDetection: false) in next.config.js, Hebrew (he) was missing from the next-i18next.config.js and switcher definitions, and there was no developer documentation on how to add new languages.

Solution implemented
Enabled Next.js's built-in locale detection, integrated missing languages into the configuration, extracted hard-coded strings in the LanguageSwitcher to utilize next-i18next's translation hook, mapped missing RTL language rules, added comprehensive translations for the switcher across all configured languages, and documented the process for future expansions.

Key changes made

  • next.config.js: Enabled automatic language detection (localeDetection: true).
  • next-i18next.config.js: Added Hebrew (he) to the supported locales list.
  • src/components/LanguageSwitcher.tsx: Extracted hardcoded texts (e.g. "Select Your Language", "Search languages...") and replaced them with t() calls from useTranslation. Added Hebrew to the languages array with rtl: true.
  • public/locales/**/common.json: Added languageSwitcher translation objects in English (en), Spanish (es), French (fr), Chinese (zh), and Arabic (ar). Created a new directory for Hebrew (he) and added initial translations.
  • README.md: Added an "Internationalization (i18n)" section outlining the standard 4-step process to add new languages.

Any trade-offs or considerations

  • Extracted user-facing strings specifically in the LanguageSwitcher to establish a clear pattern for the rest of the application. Extracting every single string in a massive application all at once could introduce merge conflicts with other feature branches; this establishes the architecture and implements it for the core shell component.
  • The language names (e.g., "English", "Español") inside the switcher remain static in English or their native format. This is intentional to ensure users can always recognize their preferred language regardless of the currently active localized interface.

Testing steps (how to verify the fix)

  1. Run npm run dev and navigate to http://localhost:3000.
  2. Open the Language Switcher in the top right.
  3. Switch to a LTR language (e.g., Spanish, French, Chinese) and confirm that the language switcher's text (like "Select Your Language", "Search languages...") translates immediately to the selected language.
  4. Switch to an RTL language (Arabic or Hebrew) and verify that the page layout automatically shifts to Right-to-Left, and the font updates to the regional font family seamlessly.
  5. Verify that checking your browser with a different default language automatically detects and redirects to the appropriate locale upon initial visit.

Please kindly review this task. If there are any corrections, improvements, adjustments, or merge conflicts that you notice regarding my implementation, I'd really appreciate your feedback. I'd also love to hear your overall review of my work on this branch.Thank you!

@jobbykings
jobbykings merged commit 14c547f into Epondia:main Jul 24, 2026
16 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.

[Frontend] Add internationalization (i18n) support

2 participants