feat: i18n supports

This commit is contained in:
GyDi
2022-03-12 23:07:45 +08:00
parent a393b8b122
commit 4991f7ff39
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,
},
});

View File

@@ -120,6 +120,7 @@ export namespace CmdType {
}
export interface VergeConfig {
language?: string;
theme_mode?: "light" | "dark";
theme_blur?: boolean;
traffic_graph?: boolean;