Skip to content

feat: add internationalization locale translations#744

Open
EmmyKay0026 wants to merge 2 commits into
StellaBridge:mainfrom
EmmyKay0026:feature/i18n-locale-translations
Open

feat: add internationalization locale translations#744
EmmyKay0026 wants to merge 2 commits into
StellaBridge:mainfrom
EmmyKay0026:feature/i18n-locale-translations

Conversation

@EmmyKay0026

Copy link
Copy Markdown

Description

This PR implements full internationalization (i18n) support by adding comprehensive locale translations for the highest-priority target languages. It ensures that all hard-coded strings (specifically within the Settings UI and toast notifications) are extracted and hooked into the translation system so the application can be seamlessly localized.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Refactoring (no functional changes)
  • Documentation update
  • CI/CD change
  • Dependency update

Related Issue

Closes #676

Changes Made

  • Extracted ~18 hard-coded English strings from Settings.tsx and mapped them to t() translation keys, including toast notifications.
  • Added 7 new language translation files (ar, de, es, fr, ja, ko, zh) that perfectly mirror the structure and keys of en.json.
  • Integrated LanguageSwitcher to persist the active locale to localStorage and switch languages dynamically.
  • Implemented RTL (Right-to-Left) document direction support for the Arabic (ar) locale.
  • Added programmatic completeness tests (localeCompleteness.test.ts) to ensure all non-English translation files maintain 100% key parity with en.json to prevent future drift.

Testing

  • Unit tests pass locally (npm run test:unit)
  • Integration tests pass locally (npm run test:integration)
  • New tests added for new behaviour
  • Manual testing completed — describe below if relevant

Manual test steps (if applicable):
Started frontend dev environment, switched through the 8 available languages in the Settings dropdown. Confirmed localStorage is updated, the Arabic locale successfully updates <html> to dir="rtl", and all strings on the Settings page are fully localized without any fallback to hard-coded text.

Migration Changes

  • No database migrations in this PR
  • New migration file generated with npm run migrate:make
  • Migration validated with npm run migrate:validate
  • down() function tested locally
  • No data loss in the rollback path

Documentation

  • No documentation changes needed
  • README.md updated (new commands, endpoints, or setup steps)
  • Relevant docs/ file updated
  • .env.example updated (new environment variables)
  • Inline comments / JSDoc updated for changed functions
  • backend/docs/API.md updated (new or changed endpoints)

Checklist

  • Branch is up to date with main
  • PR title follows Conventional Commits format (type(scope): summary)
  • Code follows project style — linters pass (npm run lint, cargo clippy)
  • Build succeeds (npm run build, cargo build --release)
  • No console.log / println! left in production code
  • No secrets, credentials, or .env files committed
  • Self-review completed — I have read my own diff

CI Status

  • Backend lint, build, and tests pass
  • Frontend lint, build, and tests pass
  • Contract format check, Clippy, and tests pass
  • Security scan passes (no new vulnerabilities)
  • Docker build succeeds

Additional Notes

The completeness tests use a recursive algorithm to flatten nested keys. This means any future developer adding a key to en.json without updating the other 7 languages will automatically trigger a CI failure, ensuring localization stays 100% consistent moving forward.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@EmmyKay0026 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Mosas2000

Copy link
Copy Markdown
Contributor

Fix the conflict

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.

Add Internationalization Locale Translations

2 participants