robosats/frontend/src/components/i18n.js

47 lines
1.1 KiB
JavaScript
Raw Normal View History

import i18n from "i18next";
import LanguageDetector from "i18next-browser-languagedetector";
import { initReactI18next } from "react-i18next";
import HttpApi from 'i18next-http-backend';
import translationEN from "../locales/en.json";
import translationES from "../locales/es.json";
import translationDE from "../locales/de.json";
import translationRU from "../locales/ru.json";
import translationZH from "../locales/zh.json";
import translationPL from "../locales/pl.json";
i18n
.use(HttpApi)
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources: {
en: {translations: translationEN},
es: {translations: translationES},
ru: {translations: translationRU},
de: {translations: translationDE},
zh: {translations: translationZH},
pl: {translations: translationPL},
},
fallbackLng: "en",
2022-04-17 19:14:22 +00:00
debug: false,
// have a common namespace used around the full app
ns: ["translations"],
defaultNS: "translations",
keySeparator: false, // we use content as keys
interpolation: {
escapeValue: false,
formatSeparator: ","
},
2022-04-10 15:11:11 +00:00
react: {
wait: true,
useSuspense: false,
}
});
export default i18n;