mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-26 14:19:24 +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),
|
supportedLngs: Object.keys(supportedLanguages),
|
||||||
nonExplicitSupportedLngs: false,
|
nonExplicitSupportedLngs: false,
|
||||||
debug: process.env.NODE_ENV === 'development',
|
debug: process.env.NODE_ENV === 'development',
|
||||||
|
|
||||||
// Ensure synchronous loading to prevent timing issues
|
// Ensure synchronous loading to prevent timing issues
|
||||||
initImmediate: false,
|
initImmediate: false,
|
||||||
|
|
||||||
interpolation: {
|
interpolation: {
|
||||||
escapeValue: false, // React already escapes values
|
escapeValue: false, // React already escapes values
|
||||||
},
|
},
|
||||||
|
|
||||||
backend: {
|
backend: {
|
||||||
loadPath: (lngs, namespaces) => {
|
loadPath: (lngs: string[], namespaces: string[]) => {
|
||||||
// Map 'en' to 'en-GB' for loading translations
|
// Map 'en' to 'en-GB' for loading translations
|
||||||
const lng = lngs[0] === 'en' ? 'en-GB' : lngs[0];
|
const lng = lngs[0] === 'en' ? 'en-GB' : lngs[0];
|
||||||
return `/locales/${lng}/${namespaces[0]}.json`;
|
return `/locales/${lng}/${namespaces[0]}.json`;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
detection: {
|
detection: {
|
||||||
order: ['localStorage', 'navigator', 'htmlTag'],
|
order: ['localStorage', 'navigator', 'htmlTag'],
|
||||||
caches: ['localStorage'],
|
caches: ['localStorage'],
|
||||||
convertDetectedLanguage: (lng: string) => lng === 'en' ? 'en-GB' : lng,
|
convertDetectedLanguage: (lng: string) => lng === 'en' ? 'en-GB' : lng,
|
||||||
},
|
},
|
||||||
|
|
||||||
react: {
|
react: {
|
||||||
useSuspense: true, // Enable suspense to prevent premature rendering
|
useSuspense: true, // Enable suspense to prevent premature rendering
|
||||||
bindI18n: 'languageChanged loaded',
|
bindI18n: 'languageChanged loaded',
|
||||||
@ -101,4 +101,4 @@ i18n.on('languageChanged', (lng) => {
|
|||||||
document.documentElement.lang = lng;
|
document.documentElement.lang = lng;
|
||||||
});
|
});
|
||||||
|
|
||||||
export default i18n;
|
export default i18n;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user