-
Notifications
You must be signed in to change notification settings - Fork 67
Closed
Labels
Description
In case if we use locale that does not presented. For example:
loadMessages({
'en': {
welcome: 'Hallo, heute ist der {date}',
}
})
And we use GlobalizeProvider
with localeFallback: "en"
When user is in locale sv
for example, we get the following error:
[RNGlobalize] CLDR data for the selected language/locale has not been loaded!
The reason, that in the code we have:
cfg.locale = (cfg.fallback && findFallbackLocale(cfg.locale)) as string; |
It means if cfg.fallback is "en", we still try to findFallbackLocale
for locale sv
which does not exist
We need to change it to:
cfg.locale = (cfg.fallback && findFallbackLocale(cfg.fallback)) as string;