feat: i18n supports

This commit is contained in:
GyDi
2022-03-12 23:07:45 +08:00
parent 9f171a01e8
commit 97254a1e3a
19 changed files with 254 additions and 60 deletions

17
src/services/i18n.ts Normal file
View File

@@ -0,0 +1,17 @@
import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "../locales/en.json";
import zh from "../locales/zh.json";
const resources = {
en: { translation: en },
zh: { translation: zh },
};
i18n.use(initReactI18next).init({
resources,
lng: "en",
interpolation: {
escapeValue: false,
},
});