Skip to content

Fallback locale does not fork #59

@akolpakov

Description

@akolpakov

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;

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions