mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-26 06:09:23 +00:00
Merge remote-tracking branch 'origin' into bug/v2/reduce-console-pollution
This commit is contained in:
commit
f0a04566b0
@ -61,28 +61,28 @@ i18n
|
||||
supportedLngs: Object.keys(supportedLanguages),
|
||||
nonExplicitSupportedLngs: false,
|
||||
debug: process.env.NODE_ENV === 'development',
|
||||
|
||||
|
||||
// Ensure synchronous loading to prevent timing issues
|
||||
initImmediate: false,
|
||||
|
||||
|
||||
interpolation: {
|
||||
escapeValue: false, // React already escapes values
|
||||
},
|
||||
|
||||
|
||||
backend: {
|
||||
loadPath: (lngs, namespaces) => {
|
||||
loadPath: (lngs: string[], namespaces: string[]) => {
|
||||
// Map 'en' to 'en-GB' for loading translations
|
||||
const lng = lngs[0] === 'en' ? 'en-GB' : lngs[0];
|
||||
return `/locales/${lng}/${namespaces[0]}.json`;
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
detection: {
|
||||
order: ['localStorage', 'navigator', 'htmlTag'],
|
||||
caches: ['localStorage'],
|
||||
convertDetectedLanguage: (lng: string) => lng === 'en' ? 'en-GB' : lng,
|
||||
},
|
||||
|
||||
|
||||
react: {
|
||||
useSuspense: true, // Enable suspense to prevent premature rendering
|
||||
bindI18n: 'languageChanged loaded',
|
||||
@ -101,4 +101,4 @@ i18n.on('languageChanged', (lng) => {
|
||||
document.documentElement.lang = lng;
|
||||
});
|
||||
|
||||
export default i18n;
|
||||
export default i18n;
|
||||
|
Loading…
x
Reference in New Issue
Block a user