更改默认语言和时区

This commit is contained in:
admin8800
2026-05-10 16:12:39 +08:00
parent 8126c2b663
commit f63ec0db18
7 changed files with 52 additions and 54 deletions
+42 -42
View File
@@ -1,42 +1,42 @@
import { createI18n } from 'vue-i18n'
import en from './en'
import fa from './fa'
import vi from './vi'
import zhcn from './zhcn'
import zhtw from './zhtw'
import ru from './ru'
export const i18n = createI18n({
legacy: false,
locale: localStorage.getItem("locale") ?? 'en',
fallbackLocale: 'en',
messages: {
en: en,
fa: fa,
vi: vi,
zhHans: zhcn,
zhHant: zhtw,
ru: ru
},
})
export const locale = (() => {
const l = i18n.global.locale.value
switch (l) {
case "zhHans":
return "zh-cn"
case "zhHant":
return "zh-tw"
default:
return l
}
})()
export const languages = [
{ title: 'English', value: 'en' },
{ title: 'فارسی', value: 'fa' },
{ title: 'Tiếng Việt', value: 'vi' },
{ title: '简体中文', value: 'zhHans' },
{ title: '繁體中文', value: 'zhHant' },
{ title: 'Русский', value: 'ru' },
]
import { createI18n } from 'vue-i18n'
import en from './en'
import fa from './fa'
import vi from './vi'
import zhcn from './zhcn'
import zhtw from './zhtw'
import ru from './ru'
export const i18n = createI18n({
legacy: false,
locale: localStorage.getItem("locale") ?? 'zhHans',
fallbackLocale: 'zhHans',
messages: {
en: en,
fa: fa,
vi: vi,
zhHans: zhcn,
zhHant: zhtw,
ru: ru
},
})
export const locale = (() => {
const l = i18n.global.locale.value
switch (l) {
case "zhHans":
return "zh-cn"
case "zhHant":
return "zh-tw"
default:
return l
}
})()
export const languages = [
{ title: 'English', value: 'en' },
{ title: 'فارسی', value: 'fa' },
{ title: 'Tiếng Việt', value: 'vi' },
{ title: '简体中文', value: 'zhHans' },
{ title: '繁體中文', value: 'zhHant' },
{ title: 'Русский', value: 'ru' },
]
+2 -2
View File
@@ -49,8 +49,8 @@ export default createVuetify({
},
},
locale: {
locale: localStorage.getItem("locale") ?? 'en',
fallback: 'en',
locale: localStorage.getItem("locale") ?? 'zhHans',
fallback: 'zhHans',
messages: { en, fa, vi, zhHans, zhHant, ru },
},
})
+1 -2
View File
@@ -96,7 +96,7 @@ const login = async () => {
}
}
const changeLocale = (l: any) => {
locale.current.value = l ?? 'en'
locale.current.value = l ?? 'zhHans'
localStorage.setItem('locale', locale.current.value)
}
const changeTheme = (th: string) => {
@@ -108,4 +108,3 @@ const isActiveTheme = (th: string) => {
return current == th
}
</script>
+1 -1
View File
@@ -162,7 +162,7 @@ const settings = ref({
webURI: "",
sessionMaxAge: "0",
trafficAge: "30",
timeLocation: "Asia/Tehran",
timeLocation: "Asia/Shanghai",
subListen: "",
subPort: "2096",
subPath: "/sub/",