This commit is contained in:
31
i18n.ts
Normal file
31
i18n.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
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;
|
||||
Reference in New Issue
Block a user