34 lines
717 B
TypeScript
34 lines
717 B
TypeScript
import i18n from "i18next";
|
|
import { initReactI18next } from "react-i18next";
|
|
import I18nextBrowserLanguageDetector from "i18next-browser-languagedetector";
|
|
|
|
import moment from "moment";
|
|
|
|
import "moment/locale/pl"
|
|
import "moment/locale/en-gb"
|
|
|
|
const resources = {
|
|
en: {
|
|
translation: require('../translations/en.yaml'),
|
|
},
|
|
pl: {
|
|
translation: require('../translations/pl.yaml'),
|
|
}
|
|
}
|
|
|
|
i18n
|
|
.use(I18nextBrowserLanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources,
|
|
fallbackLng: "en",
|
|
interpolation: {
|
|
escapeValue: false
|
|
}
|
|
})
|
|
|
|
document.documentElement.lang = i18n.language;
|
|
moment.locale(i18n.language)
|
|
|
|
export default i18n;
|