From f15ad3456b47e43646234b9c91c3ddd77ab2cd02 Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Wed, 05 Jun 2024 10:05:13 +0800
Subject: [PATCH] 123
---
src/locales/index.js | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/src/locales/index.js b/src/locales/index.js
index 56f1a1b..ea7aa1d 100644
--- a/src/locales/index.js
+++ b/src/locales/index.js
@@ -1,7 +1,11 @@
import Vue from "vue";
import VueI18n from "vue-i18n";
-import zh from "./zh.js";
-import en from "./en.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);
@@ -9,15 +13,27 @@
const LOCALE_KEY = "language";
const locales = {
- 'zh-CN': {
- ...zh
- },
en: {
...en
+ },
+ hi: {
+ ...india
+ },
+ "zh-TW": {
+ ...tw
+ },
+ th: {
+ ...ty
+ },
+ ja: {
+ ...ry
+ },
+ ko: {
+ ...hy
}
};
// en-us zh-cn
-//let langLocale = getCookie(LOCALE_KEY) || 'en';
+// let langLocale = getCookie(LOCALE_KEY) || 'en';
if (!window.localStorage.getItem(LOCALE_KEY)) {
window.localStorage.setItem(LOCALE_KEY, DEFAULT_LANG);
}
@@ -40,7 +56,7 @@
export const setup = lang => {
if (lang === undefined) {
// lang = window.localStorage.getItem(LOCALE_KEY);
- //const language = getCookie(LOCALE_KEY);
+ // const language = getCookie(LOCALE_KEY);
const language = window.localStorage.getItem(LOCALE_KEY);
if (language) {
langLocale = language.replace("-", "_").toLowerCase();
--
Gitblit v1.9.3