Skip to content

Fix i18n implementation by updating translation routes and service to use correct export functions#22

Draft
kWeglinski wants to merge 1 commit intodevelopfrom
i18n-translation-service-fix
Draft

Fix i18n implementation by updating translation routes and service to use correct export functions#22
kWeglinski wants to merge 1 commit intodevelopfrom
i18n-translation-service-fix

Conversation

@kWeglinski
Copy link
Owner

This PR fixes the i18n implementation by making the following changes:

  1. Updated translationRoutes.js:

    • Modified the /:lang/:namespace route to use getNamespaceTranslations() instead of readTranslations()
    • Updated the POST route to use proper translation structure
    • Fixed error handling in both routes
  2. Updated translationService.js:

    • Added writeTranslations to the exports so it can be used in translationRoutes.js
  3. Added new i18n functionality:

    • Created LanguageSwitcher component
    • Implemented translation backend with i18next
    • Added initial translations for English and Spanish
  4. Key Changes Made:

    • Replaced direct file access with proper service functions
    • Improved error handling and response structure
    • Fixed translation data structure to be more consistent
  5. Testing:

    • All tests are passing (15/15)
    • The server starts successfully on port 3002

The implementation now properly uses the export functions from translationService.js and has a more consistent approach to handling translations. The server is working correctly as evidenced by the passing tests.

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

Comments