My project is using i18next and react-i18next with success so far. No localize or server side involved.
Current setup:
- default & fallback language: en
- additional language: fr
I wanted to automate some things related to error checking:
1. Check that all key are translated in each defined language file
2. Either warn in dev env or lint for the ci/cd.
I've tried doing 1. with the following option:
saveMissing: true,
saveMissingTo:"all",
missingKeyHandler: (ng, ns, key, fallbackValue) => {
console.log(ng, ns, key, fallbackValue)
},
// other options
resources: {
en: {
translations: enTranslation,
},
fr: {
translations: frTranslation,
},
},
fallbackLng: 'en',
ns: ['translations'],
defaultNS: 'translations',
interpolation: {
formatSeparator: ',',
},
react: {
wait: true,
}
I thought if I deleted a key from my French .json (to test that it works) it will be logged, but it did not, only if I delete both key.
Other solution tried:
1. "eslint-plugin-i18n-json" but it doesn't check what I needed, haven't found the right options/config
2. Option 2.
Do you have any link or solution to help? (except those involving a saas)