From 2052d85da5d4d688a4ca097aec24c5c83faf1285 Mon Sep 17 00:00:00 2001 From: Aral Roca Gomez Date: Sat, 4 Nov 2023 13:27:16 +0100 Subject: [PATCH] fix(i18n-provider): fix locale to ignore detection (#1170) --- src/I18nProvider.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/I18nProvider.tsx b/src/I18nProvider.tsx index cec17c05..8230eb33 100644 --- a/src/I18nProvider.tsx +++ b/src/I18nProvider.tsx @@ -24,7 +24,7 @@ export default function I18nProvider({ const lang = lng || parentLang || locale || defaultLocale || '' const config = { ...internal.config, ...newConfig } const localesToIgnore = config.localesToIgnore || ['default'] - const ignoreLang = localesToIgnore.includes(lang) + const ignoreLang = !lang || localesToIgnore.includes(lang) const pluralRules = new Intl.PluralRules(ignoreLang ? undefined : lang) const t = transCore({ config, allNamespaces, pluralRules, lang })