From 65bb290bf08076f5eb014e6e45e6fe04dad96d79 Mon Sep 17 00:00:00 2001 From: "Tim O. Peters" Date: Sat, 4 Nov 2023 13:20:00 +0100 Subject: [PATCH] fix: ignore empty lang value #1162 (#1163) --- src/createTranslation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/createTranslation.tsx b/src/createTranslation.tsx index e50909d..8509903 100644 --- a/src/createTranslation.tsx +++ b/src/createTranslation.tsx @@ -5,7 +5,7 @@ import wrapTWithDefaultNs from './wrapTWithDefaultNs' export default function createTranslation(defaultNS?: string) { const { lang, namespaces, config } = globalThis.__NEXT_TRANSLATE__ ?? {} const localesToIgnore = config.localesToIgnore || ['default'] - const ignoreLang = localesToIgnore.includes(lang) + const ignoreLang = !lang || localesToIgnore.includes(lang) const t = transCore({ config, allNamespaces: namespaces,