Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.use(LanguageDetector)
// pass the i18n instance to react-i18next.
.use(initReactI18next)
// init i18next
// for all options read: https://www.i18next.com/overview/configuration-options
.init({
fallbackLng: 'en',
interpolation: {
escapeValue: false, // not needed for react as it escapes by default
},
});
if(process.env.NODE_ENV === 'development') {
const { applyClientHMR } = require('i18next-hmr');
applyClientHMR(i18n);
}
export default i18n;
de: 'de',
},
all: {
en: 'en',
de: 'de',
},
};
const nextI18Next = new NextI18Next({
otherLanguages: ['de'],
localeSubpaths: localeSubpathVariations[localeSubpaths],
});
if (process.env.NODE_ENV === 'development') {
const { applyClientHMR } = require('i18next-hmr');
applyClientHMR(nextI18Next.i18n);
}
module.exports = nextI18Next;