Files
everyone-can-use-english/enjoy/src/renderer/i18n.ts
an-lee d2510d00cb Feat: more preferences (#106)
* add ffmpeg command check

* may switch language

* tweak
2024-01-14 16:54:15 +08:00

31 lines
724 B
TypeScript

import * as i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "@/i18n/en.json";
import zh_CN from "@/i18n/zh-CN.json";
// the translations
// (tip move them in a JSON file and import them,
// or even better, manage them separated from your code: https://react.i18next.com/guides/multiple-translation-files)
const resources = {
en: {
translation: en,
},
"zh-CN": {
translation: zh_CN,
},
};
i18n
.use(initReactI18next) // passes i18n down to react-i18next
.init({
resources,
lng: "en",
supportedLngs: ["en", "zh-CN"],
fallbackLng: "en",
interpolation: {
escapeValue: false, // react already safes from xss
},
});
export default i18n;