dcc
2024-05-17 b8f6f514b675fa6a006dfafbc99303b3c5c8ba85
src/locales/index.js
@@ -1,35 +1,34 @@
import Vue from "vue";
import VueI18n from "vue-i18n";
// import en from "./en.js";
import en from "./zh.js";
import india from "@/locales/india";
import tw from "@/locales/tw";
import ty from "@/locales/taiyu.js";
import ry from "@/locales/riyu.js";
import hy from "@/locales/hanyu.js";
import en from "./en.json";
import india from "@/locales/india.json";
import tw from "@/locales/tw.json";
import ty from "@/locales/taiyu.json";
import ry from "@/locales/riyu.json";
import hy from "@/locales/hanyu.json";
Vue.use(VueI18n);
const DEFAULT_LANG = "zh-CN";
const DEFAULT_LANG = "en";
const LOCALE_KEY = "language";
const locales = {
  "zh-CN": {
  en: {
    ...en
  },
  en: {
  hi: {
    ...india
  },
  tw: {
  "zh-TW": {
    ...tw
  },
  ty: {
  th: {
    ...ty
  },
  ry: {
  ja: {
    ...ry
  },
  hy: {
  ko: {
    ...hy
  }
};
@@ -40,7 +39,8 @@
}
let langLocale = window.localStorage.getItem(LOCALE_KEY)
  ? window.localStorage.getItem(LOCALE_KEY)
  : "zh-CN";
  : "en";
console.log(langLocale)
const i18n = new VueI18n({
  locale: langLocale,
  messages: locales,
@@ -70,7 +70,7 @@
    }
    // console.log(`lang-${lang}`);
  }
  console.log(lang)
  Vue.config.lang = lang;
  i18n.locale = lang;
};