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

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

Open
StErMi opened this issue Apr 24, 2018 · 0 comments

Comments

@StErMi
Copy link

StErMi commented Apr 24, 2018

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?

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

No branches or pull requests

1 participant