v26.4.5
Fixed 3
- hasLoadedNamespace(ns, { lng }) no longer stays false forever when the passed lng is loaded under another code or not at all, by checking the code the language is actually loaded under
- For an lng outside supportedLngs, hasLoadedNamespace only waits for the fallback language, which is what t() resolves to
- Prevents react-i18next useTranslation(ns, { lng }) from never becoming ready, which caused endless suspense retries and a loop in the load effect
From i18next
- fix:
hasLoadedNamespace(ns, { lng })no longer staysfalseforever when the passed inlngis loaded under another code, or not at all. It checked the load state of the rawlng, butloadLanguages()stores a language under its resolved code (de-ch→de-CH,de-CH→dewithload: 'languageOnly') and skips alngoutsidesupportedLngsentirely (only the fallback gets loaded), so that state never got set. react-i18next'suseTranslation(ns, { lng })then never became ready: withuseSuspenseit kept throwing an already resolved promise and React retried forever (100% CPU, SSR never finished), without it the load effect re-rendered in a loop. It now checks the code the language is actually loaded under, and for alngoutsidesupportedLngsonly waits for the fallback, which is also whatt()resolves to. Calls withoutlngand theprecheck(react-i18next'sbindI18n: 'languageChanging') are unchanged (react-i18next#1934).