Default Locale to EN if not supported (#163)
This commit is contained in:
parent
5b06110e2d
commit
549ae558e7
@ -57,9 +57,8 @@ export default (store: any) => (next: any) => async (action: PayloadAction<any>)
|
||||
} else if (globalThis.navigator?.language) {
|
||||
const browserLanguageBaseTag = globalThis.navigator.language.split('-')[0].toLowerCase();
|
||||
|
||||
const locale = SUPPORTED_BASE_TAGS_LOCALE_MAPPING[
|
||||
browserLanguageBaseTag
|
||||
] as SupportedLocales;
|
||||
const locale = (SUPPORTED_BASE_TAGS_LOCALE_MAPPING[browserLanguageBaseTag] ??
|
||||
SUPPORTED_BASE_TAGS_LOCALE_MAPPING[SupportedLocales.EN]) as SupportedLocales;
|
||||
|
||||
if (locale) {
|
||||
store.dispatch(setSelectedLocale({ locale, isAutoDetect: true }));
|
||||
|
||||
Loading…
Reference in New Issue
Block a user