2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-06 13:37:13 +08:00

feat: 完善翻译工作流

This commit is contained in:
2025-04-13 02:35:22 +08:00
parent 59cfa096b4
commit fa7fca1f11
7 changed files with 32 additions and 3661 deletions

View File

@@ -1,6 +1,7 @@
import type { App } from 'vue'
import { createGettext as vue3Gettext } from 'vue3-gettext'
import translations from '@/locales/translations.json'
export let gettext: ReturnType<typeof vue3Gettext>
export function $gettext(msgid: string, params?: Record<string, string | number>) {
@@ -16,18 +17,6 @@ export function $ngettext(
return gettext.$ngettext(msgid, plural, n, params)
}
export function setupGettext(app: App) {
gettext = vue3Gettext({
availableLanguages: {
en: 'English',
zh_CN: '简体中文',
zh_TW: '繁體中文'
},
defaultLanguage: 'zh_CN'
})
app.use(gettext)
}
export function createGettext(): any {
gettext = vue3Gettext({
availableLanguages: {
@@ -35,7 +24,8 @@ export function createGettext(): any {
zh_CN: '简体中文',
zh_TW: '繁體中文'
},
defaultLanguage: 'zh_CN'
defaultLanguage: 'zh_CN',
translations: translations
})
return gettext