From 07ed170fd71c85b58d3655f2d9d773f1f5a94f96 Mon Sep 17 00:00:00 2001 From: Nicola Benaglia Date: Mon, 21 Apr 2025 21:32:38 +0200 Subject: [PATCH] Use language detected from browser --- i18n.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/i18n.js b/i18n.js index e785beb..631d33a 100644 --- a/i18n.js +++ b/i18n.js @@ -25,10 +25,6 @@ i18n .use(initReactI18next) .use(capitalize) .init({ - debug: isDev, - fallbackLng: 'en', - ns: ['auth', 'core', 'tutorial'], - supportedLngs: ['en', 'it'], backend: { backends: [LocalStorageBackend, HttpBackend], backendOptions: [ @@ -40,9 +36,14 @@ i18n }, ], }, + debug: isDev, + fallbackLng: 'en', interpolation: { escapeValue: false, }, + lng: navigator.language, + ns: ['auth', 'core', 'tutorial'], + supportedLngs: ['en', 'it'], }); export default i18n;