Closed artuska closed 5 years ago
I also tried this:
providers: [
{
provide: MESSAGE_FORMAT_CONFIG,
useValue: {
locales: ['en', 'ru']
}
}
]
And still got console errors about invalid plural keys.
Then I tried this:
providers: [
{
provide: MESSAGE_FORMAT_CONFIG,
useValue: {
locales: ['ru', 'en']
}
}
]
And it works... but it is just a dirty workaround.
locales
array will be the default locale. I will mention this explicitely in the README though, so thank you for the feedback.defaultLocale
configuration option. I don't think adding it makes sense - the value of locales
would override it anyway.compile()
method is called with an undefined language, which shouldn't be the case with ngx-translate.@artuska If that still bothers you, please debug the problem some more (see point 3 above) - otherwise feel free to close this issue.
Messagesformat's default locale is EN. When
ngx-translate-messageformat-compiler
loads my locale JSON file it first parses it with EN locale and throws me an errors like this:This is my module config:
As you see i have explicitly set
defaultLocale
toru
but with no success — i still got console errors about invalid plural keys.