fix(i18n): add missing zh-TW frontend components and configs (#117)

* fix(i18n): add zh-TW to language options in settings menu

* fix(i18n): add zh-TW to language options in splash layer

* fix(i18n): add zh-TW support to setLocale function

* feat(i18n): add zh-TW game config files (names)

* feat(i18n): add zh-TW AI prompt templates

* docs:修正 glossary 繁中欄位

* docs:解決 glossary 衝突

* fix(i18n):補齊 zh-TW world info 標題
This commit is contained in:
teps3105
2026-02-02 20:56:21 +08:00
committed by GitHub
parent d9e7d824a6
commit be6e3d43c0
22 changed files with 2264 additions and 268 deletions

View File

@@ -41,6 +41,7 @@ onMounted(() => {
const languageOptions = [
{ label: '简体中文', value: 'zh-CN' },
{ label: '繁體中文', value: 'zh-TW' },
{ label: 'English', value: 'en-US' }
]

View File

@@ -30,6 +30,7 @@ const activeTab = ref<'save' | 'load' | 'create' | 'delete' | 'llm' | 'start' |
const languageOptions = [
{ label: '简体中文', value: 'zh-CN' },
{ label: '繁體中文', value: 'zh-TW' },
{ label: 'English', value: 'en-US' }
]

View File

@@ -6,7 +6,7 @@ import { systemApi } from '../api/modules/system';
export const useSettingStore = defineStore('setting', () => {
const locale = ref(localStorage.getItem('app_locale') || 'zh-CN');
async function setLocale(lang: 'zh-CN' | 'en-US') {
async function setLocale(lang: 'zh-CN' | 'zh-TW' | 'en-US') {
// 1. Optimistic UI update
locale.value = lang;
localStorage.setItem('app_locale', lang);
@@ -16,7 +16,12 @@ export const useSettingStore = defineStore('setting', () => {
(i18n.global.locale as any).value = lang;
}
// Update HTML lang attribute for accessibility
document.documentElement.lang = lang === 'zh-CN' ? 'zh-CN' : 'en';
const langMap: Record<string, string> = {
'zh-CN': 'zh-CN',
'zh-TW': 'zh-TW',
'en-US': 'en'
};
document.documentElement.lang = langMap[lang] || 'en';
// 2. Sync with backend
await syncBackend();