fix: remove namespace preload

This commit is contained in:
melvinchia3636
2026-06-24 01:46:48 +08:00
parent aed7b924f1
commit 21d31a7025

View File

@@ -25,30 +25,6 @@ export function clientI18nConfig({
forgeAPI,
getAvailableLanguages
}: ClientI18nConfigOptions): InitOptions {
i18n.on('loaded', () => {
const loadedLangs = i18n.languages || ['en']
for (const lang of loadedLangs) {
const commonBundle = i18n.getResourceBundle(lang, 'common') as
| Record<string, unknown>
| undefined
if (commonBundle) {
const subnamespaces = Object.keys(commonBundle)
for (const sub of subnamespaces) {
i18n.addResourceBundle(
lang,
`common.${sub}`,
(commonBundle[sub] as Record<string, unknown>) || {},
true,
true
)
}
}
}
})
return {
lng: 'en',
fallbackLng: 'en',
@@ -67,8 +43,6 @@ export function clientI18nConfig({
return JSON.stringify({ key, value, options })
},
fallbackNS: false,
defaultNS: 'common',
ns: ['common'],
saveMissing: false,
parseMissingKeyHandler: (key: string) => `[MISSING LOCALE] ${key}`,
backend: {