Moved the i18n system into its own i18n file

This commit is contained in:
Mathias Wagner
2022-11-19 17:51:10 +01:00
parent 6fe5af8030
commit 4fb93038f8
+18
View File
@@ -0,0 +1,18 @@
import i18n from "i18next";
import {initReactI18next} from "react-i18next";
import LanguageDetector from 'i18next-browser-languagedetector';
import HttpApi from 'i18next-http-backend';
await i18n.use(initReactI18next).use(LanguageDetector).use(HttpApi).init({
supportedLngs: ['en', 'de'],
fallbackLng: 'en',
backend: {
loadPath: '/locales/{{lng}}.json'
},
detection: {
order: ['localStorage', 'htmlTag'],
lookupLocalStorage: 'language'
}
});
export default i18n;