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

Upgrade i18n-js to v4 #428

Open
andyduong1920 opened this issue Jul 4, 2023 · 0 comments
Open

Upgrade i18n-js to v4 #428

andyduong1920 opened this issue Jul 4, 2023 · 0 comments
Assignees

Comments

@andyduong1920
Copy link
Member

Why

  • We are using both i18n-js Ruby and i18n-js Node package v3

  • To upgrade from v3 to v4, it requires lot of changes, I tried it but failed in some step, some task I remember was

    import { I18n } from "i18n-js";
    import translations from "./translations.json";
    
    const i18n = new I18n(translations);
    
  • Remove the config.middleware.use I18n::JS::Middleware as v4 doesn't have it
  • Rename the config/i18n-js.yml to config/i18n.yml and update the content
 translations:
 - file: 'app/javascript/translations/translations.js'
   pattern:
    - '*'
  • Replace the task i18n:js:export to i18n export
  • Update the relative JS files like app/javascript/initializers/i18n.js

I tried all of them, but having 1 last issue on JS is the I18n module is not define not sure about that, I create this dedicate ticket for this upgrading, happy coding 🍺

Who Benefits?

Developers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants