From 8c24ee6c7f0bcadc29639e0ac091b69a3193ba6c Mon Sep 17 00:00:00 2001 From: jamliaoo Date: Sat, 3 Oct 2026 20:18:12 +0800 Subject: [PATCH 1/2] fix: set i18next default namespace so the desktop app can render i18next was initialised without ns/defaultNS, so besides the namespaces each component asks for it also requested its built-in default, translation, which has no file under public/locales. On the web the miss is a 404 and i18next gives up after one warning. In the packaged Electron app, electron-serve's app:// protocol reports the missing file as a network failure, so i18next-http-backend keeps retrying, the namespace never settles, and react-i18next's Suspense never resolves: the window stays blank. Point the default namespace at common, which exists for both locales. Every useTranslation / i18n.t call already passes an explicit namespace, so no lookup changes. --- src/lib/i18n.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib/i18n.js b/src/lib/i18n.js index 3c7d3fa..0609d7b 100644 --- a/src/lib/i18n.js +++ b/src/lib/i18n.js @@ -29,6 +29,12 @@ i18n .init({ lng: locale, fallbackLng: 'en', + // Every caller passes an explicit namespace. Without this, i18next also + // requests its built-in default `translation` namespace, which has no file. + // Over electron-serve's app:// protocol that miss is a network error rather + // than a 404, so the backend retries forever and Suspense never resolves. + ns: ['common'], + defaultNS: 'common', debug: true, interpolation: { escapeValue: false, // not needed for react as it escapes by default From a0cd2616f0c0c60c93cb9b0d92b1b010b5275814 Mon Sep 17 00:00:00 2001 From: jamliaoo Date: Sat, 3 Oct 2026 21:04:20 +0800 Subject: [PATCH 2/2] chore: shorten i18n default namespace comment --- src/lib/i18n.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/i18n.js b/src/lib/i18n.js index 0609d7b..bacfb48 100644 --- a/src/lib/i18n.js +++ b/src/lib/i18n.js @@ -29,10 +29,8 @@ i18n .init({ lng: locale, fallbackLng: 'en', - // Every caller passes an explicit namespace. Without this, i18next also - // requests its built-in default `translation` namespace, which has no file. - // Over electron-serve's app:// protocol that miss is a network error rather - // than a 404, so the backend retries forever and Suspense never resolves. + // Keep an existing default namespace: without it i18next requests the + // non-existent `translation.json`, which leaves the packaged Electron app blank. ns: ['common'], defaultNS: 'common', debug: true,