mirror of
https://github.com/outline/outline.git
synced 2026-06-29 19:24:25 +03:00
42 lines
817 B
JavaScript
42 lines
817 B
JavaScript
// @flow
|
|
import i18n from "i18next";
|
|
import { initReactI18next } from "react-i18next";
|
|
|
|
import de_DE from "./de_DE.json";
|
|
import en_US from "./default.json";
|
|
import pt_PT from "./pt_PT.json";
|
|
|
|
const resources = {
|
|
en_US: {
|
|
translation: en_US,
|
|
},
|
|
de_DE: {
|
|
translation: de_DE,
|
|
},
|
|
pt_PT: {
|
|
translation: pt_PT,
|
|
},
|
|
};
|
|
|
|
const initI18n = () => {
|
|
i18n.use(initReactI18next).init({
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
react: {
|
|
useSuspense: false,
|
|
},
|
|
lng:
|
|
"DEFAULT_LANGUAGE" in process.env
|
|
? process.env.DEFAULT_LANGUAGE
|
|
: "en_US",
|
|
debug: process.env.NODE_ENV !== "production",
|
|
keySeparator: false,
|
|
resources,
|
|
});
|
|
};
|
|
|
|
const languages: string[] = Object.keys(resources);
|
|
|
|
export { initI18n, languages, i18n, en_US, de_DE, pt_PT };
|