32 lines
855 B
TypeScript
32 lines
855 B
TypeScript
|
|
import React from 'react';
|
|
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
|
import en from './locales/en.json';
|
|
import tr from './locales/tr.json';
|
|
import de from './locales/de.json';
|
|
import fr from './locales/fr.json';
|
|
import es from './locales/es.json';
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources: {
|
|
en: { translation: en },
|
|
tr: { translation: tr },
|
|
de: { translation: de },
|
|
fr: { translation: fr },
|
|
es: { translation: es }
|
|
},
|
|
fallbackLng: 'en',
|
|
lng: 'en', // Force default to English as requested
|
|
interpolation: {
|
|
escapeValue: false // react already safes from xss
|
|
}
|
|
});
|
|
|
|
export default i18n;
|