feat(i18n): add multi-language UI support with 5 languages
- Add i18n framework with locale detection and cookie persistence - Support English, Traditional Chinese (zh-TW), Simplified Chinese (zh-CN), Japanese (ja), Korean (ko) - Add LanguageSelector component in navigation header - Create locale JSON files with full translations - Update all page components (root, user, results, history) with i18n support - Add client-side translation helpers for dynamic content - Auto-detect user's preferred language from browser settings - Bump version to v0.1.3
This commit is contained in:
parent
e792dfedf1
commit
33301033ae
21 changed files with 1205 additions and 89 deletions
33
README.md
33
README.md
|
|
@ -139,6 +139,39 @@ docker compose up -d
|
|||
|
||||
---
|
||||
|
||||
## 🌍 多語言支援(i18n)
|
||||
|
||||
ConvertX-CN 支援以下語言:
|
||||
|
||||
| 語言代碼 | 語言名稱 |
|
||||
| -------- | ---------------- |
|
||||
| en | English(預設) |
|
||||
| zh-TW | 繁體中文 |
|
||||
| zh-CN | 简体中文 |
|
||||
| ja | 日本語 |
|
||||
| ko | 한국어 |
|
||||
|
||||
### 語言切換
|
||||
|
||||
- 在網站右上角的導航列可看到語言選擇器(地球圖示)
|
||||
- 點擊後可選擇偏好語言
|
||||
- 語言偏好會自動保存到 Cookie 中
|
||||
- 首次訪問時會自動偵測瀏覽器語言設定
|
||||
|
||||
### 新增語言
|
||||
|
||||
如要添加新語言,請:
|
||||
|
||||
1. 在 `src/locales/` 目錄新增語言檔案(例如 `fr.json`)
|
||||
2. 在 `src/i18n/index.ts` 中:
|
||||
- 導入新語言檔案
|
||||
- 在 `supportedLocales` 陣列中添加語言配置
|
||||
- 在 `translations` 物件中註冊翻譯
|
||||
|
||||
歡迎提交 Pull Request 來新增更多語言!
|
||||
|
||||
---
|
||||
|
||||
## 📖 教學文章
|
||||
|
||||
> [!NOTE]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue