完善多语言支持

This commit is contained in:
xianyi
2026-01-20 13:58:42 +08:00
parent ebb40ec8f9
commit 37932fcf16
9 changed files with 1195 additions and 30 deletions

View File

@@ -4,13 +4,33 @@ import i18n from "i18next";
import { initReactI18next } from "react-i18next";
import en from "./locales/en.json";
import hi from "./locales/hi.json";
import id from "./locales/id.json";
import ms from "./locales/ms.json";
import th from "./locales/th.json";
import vi from "./locales/vi.json";
import zh from "./locales/zh.json";
const RESOURCES = {
en: { translation: en },
zh: { translation: zh },
hi: { translation: hi },
id: { translation: id },
ms: { translation: ms },
th: { translation: th },
vi: { translation: vi },
};
export const SUPPORTED_LANGUAGES = [
{ code: "en", name: "English" },
{ code: "zh", name: "中文" },
{ code: "hi", name: "हिन्दी" },
{ code: "id", name: "Bahasa Indonesia" },
{ code: "ms", name: "Bahasa Melayu" },
{ code: "th", name: "ไทย" },
{ code: "vi", name: "Tiếng Việt" },
];
const LANGUAGE_STORAGE_KEY = "user_language_preference";
const initI18n = async () => {