Simple translation module for fitbit apps
npm install fitbit-i18n
You should create a translation file in
resources\i18n for every locale you want to support.
The module will read the locale language from the Fitbit user settings and will look for a file named
[locale].json in the
resources\i18n folder (e.g.
If the file doesn't exist, it will look for the file named with the 2 first characters of the locale (e.g.
resources\i18n\fr.json). This permits to have a unique file for all the countries with the same language (
fr-be, fr-ca, fr-fr, ...)
Then the module will also try to load the fallback translations in the
Example, fr-fr.json could contain :
Simply import and use the module like that :
let translated = // DIMANCHE if the locale is fr-FR
SUNDAY key is found in the default language translation file => perfect.
If not, the module uses the translation from the fallback file.
If it is still not present, the key will be used.