Closed NoahKr closed 3 years ago
I figured out what I was doing wrong.
i18n.fallbacks
is a boolean and should just be true
.
The following does work:
// Set fallback chain
_.assign(i18n.locales, {
nl: ["nl", "nl_override", 'en'],
en: ["en", "en_override", 'nl'],
nl_override: ["nl_override", "nl", "en_override", "en"],
en_override: ["en_override", "en", "nl_override", "nl"]
})
You might want to update the README, but other than that very nice library :)
Thanks for your feedback
I think we do have some text in README mentioning how to enable fallback and config custom fallback rules (Search for Translation fallback can be enabled
)
But if you think we could use some formatting / content update feel free to edit and submit PR ;)
Hi, I'm using i18n-js@3.8.0 in react-native installed via npm install i18n-js@^3.8.0. I have the following configuration:
What I expect to happen: 1 If key is present in
nl_override
translation will be taken from thenl_override
file.nl_override
will be taken fromnl
, if it's not found there either, look for it inen_override
and so on.What happens:
nl_override
are taken fromen
Anyone knows what I'm doing wrong? Thanks in advance.