import i18next from 'i18next'; import Backend from 'i18next-http-backend'; import { initReactI18next } from 'react-i18next'; import LanguageDetector from 'i18next-browser-languagedetector'; i18next .use( new Backend({ loadPath: '/locales/{{lng}}/{{ns}}.json', }), ) .use(initReactI18next) .use(LanguageDetector) .init({ fallbackLng: 'es', ns: ['common'], fallbackNS: 'common', defaultNS: 'common', keySeparator: false, debug: false, detection: { order: ['htmlTag'], }, interpolation: { escapeValue: false, // react already safes from xss }, react: { useSuspense: false, }, });