Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌎 feat: Enhance Internationalization with React-i18next & i18next Integration #5720

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

rubentalstra
Copy link
Collaborator

@rubentalstra rubentalstra commented Feb 7, 2025

Summary

Closes: #5710
Closes: #5715

This PR introduces internationalization (i18n) support using react-i18next and i18next, enabling multi-language translations across the application. The implementation includes setting up translation resources, integrating language switching, and updating localization hooks. Additionally, tests have been added to verify the correctness of translations.

Changes & Enhancements

  • Added react-i18next and i18next dependencies.
  • Created client/src/locales/i18n.ts to configure i18n with multiple languages.
  • Implemented translation files for multiple locales.
  • Refactored useLocalize.ts to use i18next for translations.
  • Updated type definitions to support typed translations (TranslationKeys).
  • Added test cases (Translation.spec.ts) to ensure correct language switching and fallback behavior.
  • Modified package.json to include react-i18next and i18next.

Change Type

  • New feature (non-breaking change which adds functionality)
  • Translation update

Testing

Test Configuration:

To ensure proper functionality, the following tests have been performed:

  • Verified translations for multiple languages.
  • Ensured fallback to English for unsupported languages.
  • Tested language switching and persistence across components.
  • Validated translation placeholders with dynamic values.
  • Ran unit tests (Translation.spec.ts) to confirm correctness.

Checklist

  • My code adheres to this project's style guidelines.
  • I have performed a self-review of my own code.
  • I have commented in any complex areas of my code.
  • My changes do not introduce new warnings.
  • I have written tests demonstrating that my changes are effective.
  • Local unit tests pass with my changes.
  • A pull request for updating the documentation has been submitted (if applicable).

@rubentalstra rubentalstra linked an issue Feb 7, 2025 that may be closed by this pull request
1 task
@rubentalstra rubentalstra marked this pull request as draft February 7, 2025 17:07
@rubentalstra rubentalstra marked this pull request as ready for review February 7, 2025 17:36
@rubentalstra rubentalstra requested review from danny-avila and berry-13 and removed request for danny-avila February 7, 2025 17:36
Copy link
Collaborator

@berry-13 berry-13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@berry-13 berry-13 changed the title Add i18n Support with react-i18next and Translation Updates 🌎 feat: Enhance Internationalization with React-i18next & i18next Integration Feb 7, 2025
@rubentalstra rubentalstra added 🌍 i18n Language ✨ enhancement New feature or request and removed 🌍 i18n Language labels Feb 7, 2025
@rubentalstra rubentalstra force-pushed the refactor/i18next-localization branch from 34c15f1 to 9f5f293 Compare February 8, 2025 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request 🌍 i18n Language
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: Standardize Localization Approach Across the Application
2 participants