Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions dashboard/src/i18n/composables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export function useI18n() {
const locale = computed(() => currentLocale.value);

// 获取可用语言列表
const availableLocales: Locale[] = ['zh-CN', 'en-US', 'ru-RU'];
const availableLocales: Locale[] = ['zh-CN', 'zh-HK', 'zh-TW', 'en-US', 'ru-RU'];
Comment thread
ZvZPvz marked this conversation as resolved.

// 检查是否已加载
const isLoaded = computed(() => Object.keys(translations.value).length > 0);
Expand Down Expand Up @@ -158,6 +158,8 @@ export function useLanguageSwitcher() {

const languageOptions = computed(() => [
{ value: 'zh-CN', label: '简体中文', flag: '🇨🇳' },
{ value: 'zh-HK', label: '繁體中文(香港)', flag: '🇭🇰' },
{ value: 'zh-TW', label: '繁體中文(台灣)', flag: '🇹🇼' },
{ value: 'en-US', label: 'English', flag: '🇺🇸' },
{ value: 'ru-RU', label: 'Русский', flag: '🇷🇺' }
]);
Expand Down Expand Up @@ -221,7 +223,7 @@ function deepMerge(target: Record<string, any>, source: Record<string, any>) {
export async function setupI18n() {
// 从localStorage获取保存的语言设置
const savedLocale = localStorage.getItem('astrbot-locale') as Locale;
const initialLocale = savedLocale && ['zh-CN', 'en-US', 'ru-RU'].includes(savedLocale)
const initialLocale = savedLocale && ['zh-CN', 'zh-HK', 'zh-TW', 'en-US', 'ru-RU'].includes(savedLocale)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

为了提高代码的可维护性,建议将此处的语言环境列表提取为模块级别的常量,以便在 useI18n 函数中的 availableLocales (L106) 和此处复用。这可以避免在未来增删语言时遗漏修改。

? savedLocale
: 'zh-CN';

Expand Down
24 changes: 24 additions & 0 deletions dashboard/src/i18n/locales/zh-HK/core/actions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"create": "建立",
"read": "讀取",
"update": "更新",
"delete": "刪除",
"search": "搜尋",
"filter": "篩選",
"sort": "排序",
"export": "匯出",
"import": "匯入",
"backup": "備份",
"restore": "還原",
"copy": "複製",
"paste": "貼上",
"cut": "剪下",
"undo": "復原",
"redo": "重做",
"refresh": "重新整理",
"submit": "提交",
"reset": "重設",
"clear": "清除",
"save": "儲存",
"close": "關閉"
}
133 changes: 133 additions & 0 deletions dashboard/src/i18n/locales/zh-HK/core/common.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"save": "儲存",
"cancel": "取消",
"close": "關閉",
"copy": "複製",
"copied": "已複製",
"copyFailed": "複製失敗",
"delete": "刪除",
"edit": "編輯",
"add": "新增",
"confirm": "確認",
"loading": "載入中...",
"success": "成功",
"error": "錯誤",
"warning": "警告",
"info": "資訊",
"name": "名稱",
"description": "描述",
"author": "作者",
"status": "狀態",
"actions": "操作",
"enable": "啟用",
"disable": "停用",
"enabled": "已啟用",
"disabled": "已停用",
"reload": "重新載入",
"configure": "設定",
"install": "安裝",
"uninstall": "解除安裝",
"update": "更新",
"language": "語言",
"settings": "設定",
"locale": "zh-HK",
"type": "輸入",
"press": "點擊",
"longPress": "長按",
"yes": "是",
"no": "否",
"imagePreview": "圖片預覽",
"autoDetect": "自動偵測",
"dialog": {
"confirmTitle": "確認操作",
"confirmMessage": "你確定要執行此操作?",
"confirmButton": "確定",
"cancelButton": "取消"
},
"restart": {
"waiting": "正在等待 AstrBot 重新啟動...",
"maxRetriesReached": "輪詢狀態已達上限,請手動檢查。"
},
"readme": {
"title": "插件說明文件",
"buttons": {
"viewOnGithub": "在 GitHub 查看 Repo",
"refresh": "重新整理文件"
},
"loading": "正在載入 README 文件...",
"errors": {
"fetchFailed": "取得 README 失敗",
"fetchError": "取得 README 時發生錯誤"
},
"empty": {
"title": "此插件未提供文件連結或 GitHub Repo 網址。",
"subtitle": "請前往插件市場查看或向插件作者索取更多資訊。"
}
},
"changelog": {
"title": "更新日誌",
"loading": "正在載入更新日誌...",
"empty": {
"title": "此插件未提供更新日誌",
"subtitle": "開發者可以在插件目錄中加入 CHANGELOG.md 來提供更新日誌"
}
},
"editor": {
"fullscreen": "全螢幕編輯",
"editingTitle": "編輯內容"
},
"templateList": {
"addEntry": "新增項目",
"empty": "暫無項目,請選擇模板以新增",
"missingTemplate": "找不到對應的模板,請刪除後重新新增。",
"unknownTemplate": "未指定模板"
},
"list": {
"addItemPlaceholder": "新增項目,按 Enter 確認",
"addButton": "新增",
"addMore": "載入更多",
"batchImport": "批次匯入",
"batchImportTitle": "批次匯入",
"batchImportLabel": "每行一個項目",
"batchImportPlaceholder": "例如:\n項目 1\n項目 2\n項目 3",
"batchImportHint": "每一行將視為一個獨立的項目,空白行會自動略過",
"batchImportButton": "匯入 {count} 項",
"noItems": "暫無項目",
"noItemsHint": "暫無項目,在上方輸入文字後按 Enter 新增",
"inputPlaceholder": "輸入完成後按 Enter 新增",
"editTitle": "編輯列表項目",
"modifyButton": "修改"
},
"itemCard": {
"enabled": "已啟用",
"disabled": "已停用",
"delete": "刪除",
"edit": "編輯",
"copy": "複製",
"noData": "暫無資料"
},
"objectEditor": {
"dialogTitle": "編輯鍵值 (Key-Value)",
"noItems": "暫無項目",
"noParams": "暫無參數",
"presets": "預設",
"newKeyLabel": "新鍵名",
"valueTypeLabel": "值類型",
"keyExists": "鍵名已存在",
"invalidJson": "JSON 格式錯誤",
"placeholders": {
"keyName": "鍵名",
"stringValue": "字串值",
"numberValue": "數值",
"jsonValue": "JSON"
}
},
"firstNotice": {
"title": "首次提示",
"loading": "正在載入首次提示...",
"empty": {
"title": "暫無首次提示內容",
"subtitle": "找不到 FIRST_NOTICE.md 或者是空白檔案。"
}
}
}
108 changes: 108 additions & 0 deletions dashboard/src/i18n/locales/zh-HK/core/header.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"logoTitle": "AstrBot 儀表板",
"version": {
"hasNewVersion": "AstrBot 有新版本!",
"dashboardHasNewVersion": "WebUI 有新版本!"
},
"buttons": {
"update": "更新",
"account": "帳戶",
"theme": {
"light": "淺色模式",
"dark": "深色模式"
}
},
"updateDialog": {
"title": "更新 AstrBot",
"currentVersion": "目前版本",
"status": {
"checking": "正在檢查更新...",
"switching": "正在切換版本...",
"updating": "正在更新..."
},
"tabs": {
"release": "😊 正式版"
},
"updateToLatest": "更新至最新版本",
"preRelease": "Pre-release",
"preReleaseWarning": {
"title": "Pre-release 版本提醒",
"description": "標有 Pre-release 的版本可能存在未知問題或 Bug,不建議在正式環境中使用。如發現問題,請提交至 ",
"issueLink": "GitHub Issues"
},
"tip": "💡 提示: ",
"tipContinue": "預設在切換版本時會下載對應版本的 WebUI 檔案。WebUI 的原始碼位於專案的 dashboard 目錄中,你可以使用 npm 自行建置。",
"dockerTip": "切換版本時,會同時嘗試更新機械人主程式與管理面板。如果你使用 Docker 部署,也可以重新拉取 (Pull) 映像檔或使用 ",
"dockerTipLink": "watchtower",
"dockerTipContinue": "自動監控並更新。",
"table": {
"tag": "標籤",
"publishDate": "發佈時間",
"content": "內容",
"sourceUrl": "原始網址",
"actions": "操作",
"view": "查看",
"switch": "切換"
},
"releaseNotes": {
"title": "版本說明 (Release Notes)"
},
"redirectConfirm": {
"title": "即將跳轉",
"message": "將跳轉至 GitHub Releases 頁面,是否繼續?",
"latestLabel": "最新版本",
"targetVersion": "目標版本:",
"currentVersion": "目前版本:",
"guideTitle": "跳轉後建議:",
"guideStep1": "根據你的系統架構下載對應的安裝檔。",
"guideStep2": "安裝完成後重新啟動 AstrBot。",
"guideStep3": "如果你使用 Docker,請優先使用更新映像檔 (Image) 的方式。"
},
"desktopApp": {
"title": "更新桌面版 App",
"message": "將檢查並升級 AstrBot 桌面版 App。",
"currentVersion": "目前版本:",
"latestVersion": "最新版本:",
"checking": "正在檢查桌面版更新...",
"hasNewVersion": "發現新版本,可點擊確認進行升級。",
"isLatest": "已是最新版本",
"installing": "正在下載並安裝更新,完成後將自動重啟 App...",
"checkFailed": "檢查更新失敗,請稍後再試。",
"installFailed": "升級失敗,請稍後再試。"
},
"dashboardUpdate": {
"title": "單獨更新管理面板至最新版本",
"currentVersion": "目前版本",
"hasNewVersion": "有新版本!",
"isLatest": "已經是最新版本。",
"downloadAndUpdate": "下載並更新"
}
},
"accountDialog": {
"title": "修改帳戶",
"securityWarning": "安全提醒:請修改預設密碼以確保帳戶安全",
"form": {
"currentPassword": "目前密碼",
"newPassword": "新密碼",
"confirmPassword": "確認新密碼",
"newUsername": "新使用者名稱 (選填)",
"passwordHint": "密碼最少需要 8 個字元",
"confirmPasswordHint": "請再次輸入新密碼以作確認",
"usernameHint": "留空代表不修改使用者名稱",
"defaultCredentials": "預設使用者名稱與密碼皆為 astrbot"
},
"validation": {
"passwordRequired": "請輸入密碼",
"passwordMinLength": "密碼最少需要 8 個字元",
"passwordMatch": "兩次輸入的密碼不一致",
"usernameMinLength": "使用者名稱最少需要 3 個字元"
},
"actions": {
"save": "儲存變更",
"cancel": "取消"
},
"messages": {
"updateFailed": "修改失敗,請再試一次"
}
}
}
49 changes: 49 additions & 0 deletions dashboard/src/i18n/locales/zh-HK/core/navigation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"welcome": "歡迎",
"dashboard": "數據統計",
"platforms": "機械人",
"providers": "模型供應商",
"commands": "指令管理",
"persona": "人格設定",
"subagent": "SubAgent 編排",
"toolUse": "MCP",
"extension": "插件",
"extensionTabs": {
"installed": "AstrBot 插件",
"market": "插件市場",
"mcp": "MCP",
"skills": "Skills",
"components": "管理行為"
},
"config": "設定檔",
"chat": "聊天",
"cron": "未來任務",
"conversation": "對話數據",
"sessionManagement": "自訂規則",
"console": "平台日誌",
"trace": "追蹤",
"alkaid": "Alkaid",
"knowledgeBase": "知識庫",
"about": "關於",
"settings": "設定",
"changelog": "更新日誌",
"documentation": "官方文件",
"faq": "FAQ",
"github": "GitHub",
"drag": "拖曳",
"groups": {
"more": "更多功能"
},
"changelogDialog": {
"title": "更新日誌",
"loading": "載入中...",
"error": "載入失敗",
"notFound": "找不到此版本的更新日誌",
"selectVersion": "選擇版本",
"current": "目前"
},
"configTabs": {
"normal": "一般設定",
"system": "系統設定"
}
}
Loading
Loading