mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 08:45:41 +08:00
34 lines
905 B
TypeScript
34 lines
905 B
TypeScript
import i18n from "i18next";
|
|
import { initReactI18next } from "react-i18next";
|
|
import en from "@/locales/en.json";
|
|
import ru from "@/locales/ru.json";
|
|
import zh from "@/locales/zh.json";
|
|
import fa from "@/locales/fa.json";
|
|
import tt from "@/locales/tt.json";
|
|
import id from "@/locales/id.json";
|
|
import ar from "@/locales/ar.json";
|
|
import ko from "@/locales/ko.json";
|
|
import tr from "@/locales/tr.json";
|
|
import jp from "@/locales/jp.json";
|
|
import de from "@/locales/de.json";
|
|
import es from "@/locales/es.json";
|
|
import zhtw from "@/locales/zhtw.json";
|
|
|
|
export const languages = { en, ru, zh, fa, tt, id, ar, ko, tr, jp, de, es, zhtw };
|
|
|
|
const resources = Object.fromEntries(
|
|
Object.entries(languages).map(([key, value]) => [
|
|
key,
|
|
{ translation: value },
|
|
]),
|
|
);
|
|
|
|
i18n.use(initReactI18next).init({
|
|
resources,
|
|
lng: "zh",
|
|
fallbackLng: "en",
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
});
|