Commit Graph

5 Commits

Author SHA1 Message Date
teps3105
be6e3d43c0 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 標題
2026-02-02 20:56:21 +08:00
teps3105
f0b6b62de5 feat(i18n): add Traditional Chinese (zh-TW) locale support (#116)
* feat(i18n): add zh-TW locale support (backend infrastructure)

- 新增 LanguageType.ZH_TW 枚舉值
- 擴展 _lang_to_locale() 映射支援 zh-TW
- 創建 zh_TW 翻譯檔案結構 (messages.po + game_configs.po)
Closes #114

* feat(i18n): add zh-TW locale support (translation completion)

完成繁體中文語言的完整翻譯工作:

## 後端翻譯
- 將 messages.po 和 game_configs.po 轉換為繁體中文
- 編譯生成對應的 .mo 檔案
- 使用 OpenCC 's2t' 轉換器進行簡繁轉換

## 前端翻譯
- 新增 zh-TW.json 語言檔案
- 更新 index.ts 註冊 zh-TW 語言
- 修正 UI 語言標籤為「繁體中文」

## 翻譯統計
- messages.po: 701 個 msgid(動態字串、戰鬥、奇遇等)
- game_configs.po: 2972 個 msgid(遊戲配置)
- zh-TW.json: 347 行(前端 UI)

* feat(i18n): add zh-TW optimizations and tests

## 可選優化 1:用語本地化
- 修正前端 UI 詞彙為台灣繁體習慣
- 主要修正項目:
  - 菜單 -> 選單
  - 設置 -> 設定
  - 加載 -> 載入
  - 保存 -> 儲存
  - 程序 -> 程式
  - 其他 UI 用語調整

## 可選優化 2:測試覆蓋
- 新增 test_i18n_zh_tw.py 測試檔案
- 涵蓋 13 個測試用例:
  - 語言枚舉驗證
  - 語言切換測試
  - 日期格式驗證
  - 動態翻譯測試
  - 境界/動作/情緒翻譯測試
  - 檔案完整性檢查
  - 翻譯覆蓋率驗證
  - 回退機制測試

## 測試結果
- 所有 13 個測試用例通過
- 翻譯覆蓋率 > 95%

* fix(i18n): add polib skip check to translation coverage test

* feat(i18n): add zh-TW column to glossary with Taiwan localization
2026-02-01 13:28:18 +08:00
4thfever
e1091fdf5a Feat/i18n (#92)
* feat: add vue-i18n

* feat: add vue-i18n

* feat: add vue-i18n

* feat: add language class

* add: en templates and configs

* add: en names

* refactor: name gender id and sect id

* feat(i18n): add gettext infrastructure for dynamic text translation (#81)

* feat(i18n): add gettext infrastructure for dynamic text translation

- Add src/i18n/ module with t() translation function
- Add .po/.mo files for zh_CN and en_US locales
- Update LanguageManager to reload translations on language change
- Add comprehensive tests (14 tests, all passing)
- Add implementation spec at docs/specs/i18n-dynamic-text.md

Phase 1 of i18n dynamic text implementation.

* feat(i18n): expand .po files with comprehensive translation entries

Add translation messages for:
- Battle result messages (fatal/non-fatal outcomes)
- Fortune event messages (item discovery, cultivation gains)
- Misfortune event messages (losses, damage, regression)
- Death reason messages
- Item exchange messages (equip, sell, discard)
- Single choice context and option labels
- Common labels (weapon, auxiliary, technique, elixir)

Both zh_CN and en_US locales updated with matching entries.

* test: add .po file integrity tests

* feat: i18n for actions

* feat: i18n for effects

* feat: i18n for gathering

* feat: i18n for classes

* feat: i18n for classes

* feat: i18n for classes

* feat: i18n for classes

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* fix bugs

* update csv

* update world info

* update prompt

* update prompt

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

* update

* update

* update

* update

* update

* update

* update

---------

Co-authored-by: Zihao Xu <xzhseh@gmail.com>
2026-01-24 13:47:23 +08:00
bridge
64732d6912 update: license & contributing 2026-01-20 21:12:55 +08:00
Zihao Xu
6ed614814f feat: add i18n glossary in CSV format (Phase 0) (#67) 2026-01-20 20:54:33 +08:00