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
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
app/javascript/global.jsfollowing the guide on https://www.npmjs.com/package/i18n-js?activeTab=readmeconfig.middleware.use I18n::JS::Middlewareas v4 doesn't have itconfig/i18n-js.ymltoconfig/i18n.ymland update the contenti18n:js:exporttoi18n exportapp/javascript/initializers/i18n.jsI tried all of them, but having 1 last issue on JS is the
I18n module is not definenot sure about that, I create this dedicate ticket for this upgrading, happy coding 🍺Who Benefits?
Developers