i18n-node icon indicating copy to clipboard operation
i18n-node copied to clipboard

How to force the defaultLocale and prevent i118n-node to create new locales file?

Open StErMi opened this issue 7 years ago • 0 comments

Hi, this is my init configuration:

i18n.configure({
    locales: ['en', 'it'],
    defaultLocale: 'en',
    directory: __dirname + '/locales'
});

This is how I use i18n-node module:

let translated = i18n.__({phrase: 'api_result_value', locale: input.language}, coinName, model.price, model.coin_to, exchangeString);

I would expect that when the user locale is different from 'it' or 'en' it would fall back to 'en' and use it instead of creating a new locales file. Or at least, create that new file but use the default translation.

What am I doing wrong?

StErMi avatar Apr 24 '18 06:04 StErMi