From fe3085b4fde3c059c00a2d9c4c6f64a58cb89176 Mon Sep 17 00:00:00 2001 From: Clover You Date: Tue, 25 Nov 2025 20:12:48 +0800 Subject: [PATCH] feat(i18n): add new translation entries (#409) * feat(i18n): add internationalization support * chore: Deleted the redundant 'useLogin copy.ts' file * feat(i18n): add new translation entries --- locales/en/home.json | 15 ++ locales/en/login.json | 2 +- locales/en/menu.json | 20 +- locales/en/setting.json | 40 ++++ locales/zh-CN/home.json | 15 ++ locales/zh-CN/menu.json | 20 +- locales/zh-CN/setting.json | 40 ++++ pnpm-lock.yaml | 191 +++++++++--------- src/components/common/ContextMenu.vue | 4 +- src/hooks/useChatMain.ts | 56 ++--- src/layout/center/index.vue | 8 +- src/stores/menuTop.ts | 10 +- src/views/homeWindow/SearchDetails.vue | 14 +- src/views/moreWindow/settings/ManageStore.vue | 15 +- src/views/moreWindow/settings/Shortcut.vue | 45 +++-- src/views/moreWindow/settings/Versatile.vue | 4 +- src/views/moreWindow/settings/config.ts | 10 +- 17 files changed, 335 insertions(+), 174 deletions(-) create mode 100644 locales/en/home.json create mode 100644 locales/zh-CN/home.json diff --git a/locales/en/home.json b/locales/en/home.json new file mode 100644 index 00000000..346715d2 --- /dev/null +++ b/locales/en/home.json @@ -0,0 +1,15 @@ +{ + "search_suggestions": "Search Suggestions", + "search_guide": "Search in the search box", + "no_search_results": "No relevant results found", + "search_result": "Search Results", + "search_history": "History", + "search_input_placeholder": "Search", + "clear_search_history": "Clear", + "action": { + "message": "Hula", + "message_short_title": "Messages", + "contact": "Contacts", + "contact_short_title": "Contacts" + } +} diff --git a/locales/en/login.json b/locales/en/login.json index 2c3c66c4..563087d8 100644 --- a/locales/en/login.json +++ b/locales/en/login.json @@ -4,7 +4,7 @@ "default": "Login", "network_error": "Network Error" }, - "qr_code": "Login with QR Code" + "qr_code": "QR Code" }, "input": { "account": { diff --git a/locales/en/menu.json b/locales/en/menu.json index 2b3f0a96..9b4759cc 100644 --- a/locales/en/menu.json +++ b/locales/en/menu.json @@ -3,5 +3,23 @@ "lock_screen": "Lock Screen", "settings": "Settings", "about": "About", - "sign_out": "Sign Out" + "sign_out": "Sign Out", + "select": "Select", + "add_sticker": "Add Sticker", + "forward": "Forward", + "reply": "Reply", + "recall": "Recall", + "copy": "Copy", + "save_as": "Save as", + "show_in_finder": "Show in Finder", + "show_in_folder": "Show in Folder", + "translate": "Translate", + "del": "Delete", + "preview": "Preview", + "send_message": "Send Message", + "get_user_info": "Peek", + "modify_group_nickname": "My Alias in Group", + "add_friend": "Add Friend", + "report": "Report", + "ctx_menu_more": "More" } diff --git a/locales/en/setting.json b/locales/en/setting.json index 0bb60858..3909a8ea 100644 --- a/locales/en/setting.json +++ b/locales/en/setting.json @@ -54,5 +54,45 @@ "message_ring": "Ring", "message_unblocked": "Unblocked" }, + "shortcut": { + "title": "Shortcuts", + "global_shortcut_title": "Global", + "enable_global_shortcuts": "Enable Global Shortcuts", + "enable_global_shortcuts_hint": "After closing, all shortcuts below will be disabled.", + "function_shortcut_title": "Function", + "message_title": "Message", + "screenshot": "Screenshot", + "screenshot_hint": "Press the shortcut key to capture", + "panel_switch": "Main panel switch", + "panel_switch_hint": "Press the shortcut key to switch the main panel", + "message_shortcut": "Message", + "send_message_shortcut": "Send Message", + "send_message_shortcut_hint": "Press the shortcut key to send a message", + "send_message_shortcut_option": "Press {key} to send", + "unbound": "Unbound", + "bound": "Bound", + "reset": "Reset", + "shortcut_update_result": "{name} has been updated", + "shortcut_setting_failed": "{name} setting failed", + "global_enable": "Global shortcuts enabled", + "global_disable": "Global shortcuts disabled", + "global_toggle_failed": "Failed to set the global shortcut toggle", + "send_message_updated": "Send message shortcut updated", + "send_message_failed": "Send message shortcut failed" + }, + "storage": { + "title": "Storage", + "file_scan_progress": "Scanning Progress", + "usage": "File Scan Progress", + "used_space": "Used Space", + "app_used_space": "Hula Data", + "free_space": "Free Space", + "directory": "Directory", + "curr_dir": "Current directory" + }, + "theme": { + "title": "Theme", + "restore_default": "Restore" + }, "unknow": "Unknow" } diff --git a/locales/zh-CN/home.json b/locales/zh-CN/home.json new file mode 100644 index 00000000..4eb3c288 --- /dev/null +++ b/locales/zh-CN/home.json @@ -0,0 +1,15 @@ +{ + "search_suggestions": "建议", + "search_guide": "在搜索框内搜索", + "no_search_results": "未找到相关结果", + "search_result": "搜索结果", + "search_history": "历史记录", + "search_input_placeholder": "搜索", + "clear_search_history": "清空", + "action": { + "message": "Hula", + "message_short_title": "消息", + "contact": "好友列表", + "contact_short_title": "好友" + } +} diff --git a/locales/zh-CN/menu.json b/locales/zh-CN/menu.json index 167d6ca5..23b2fedc 100644 --- a/locales/zh-CN/menu.json +++ b/locales/zh-CN/menu.json @@ -3,5 +3,23 @@ "lock_screen": "锁定屏幕", "settings": "设置", "about": "关于", - "sign_out": "退出登录" + "sign_out": "退出登录", + "select": "选择", + "add_sticker": "添加表情", + "forward": "转发", + "reply": "回复", + "recall": "撤回", + "copy": "复制", + "save_as": "另存为", + "show_in_finder": "在 Finder 中显示", + "show_in_folder": "在文件夹中显示", + "translate": "翻译", + "del": "删除", + "preview": "预览", + "send_message": "发送消息", + "get_user_info": "查看信息", + "modify_group_nickname": "修改在群昵称", + "add_friend": "添加好友", + "report": "举报", + "ctx_menu_more": "更多" } diff --git a/locales/zh-CN/setting.json b/locales/zh-CN/setting.json index fce95ca5..dc3eb23f 100644 --- a/locales/zh-CN/setting.json +++ b/locales/zh-CN/setting.json @@ -54,5 +54,45 @@ "message_ring": "响铃", "message_unblocked": "已取消屏蔽" }, + "shortcut": { + "title": "快捷键", + "global_shortcut_title": "全局", + "enable_global_shortcuts": "启用全局快捷键", + "enable_global_shortcuts_hint": "关闭后,下方所有快捷键将失效。", + "function_shortcut_title": "功能", + "message_title": "Message", + "screenshot": "截图", + "screenshot_hint": "按快捷键进行截图", + "panel_switch": "主面板切换", + "panel_switch_hint": "按快捷键切换主面板", + "message_shortcut": "消息", + "send_message_shortcut": "发送消息", + "send_message_shortcut_hint": "按快捷键发送消息", + "send_message_shortcut_option": "按 {key} 键发送消息", + "unbound": "未绑定", + "bound": "已绑定", + "reset": "重置", + "shortcut_update_result": "{name} 已更新", + "shortcut_setting_failed": "{name} 设置失败", + "global_enable": "全局快捷键已开启", + "global_disable": "全局快捷键已关闭", + "global_toggle_failed": "全局快捷键开关设置失败", + "send_message_updated": "发送消息快捷键已更新", + "send_message_failed": "发送消息快捷键设置失败" + }, + "storage": { + "title": "存储", + "file_scan_progress": "扫描文件中", + "usage": "扫描文件占比", + "used_space": "已用空间", + "app_used_space": "Hula 数据", + "free_space": "可用空间", + "directory": "目录", + "curr_dir": "当前目录" + }, + "theme": { + "title": "主题", + "restore_default": "恢复默认" + }, "unknow": "未知" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c4a9d332..e450ef7e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1547,124 +1547,124 @@ packages: '@rolldown/pluginutils@1.0.0-beta.41': resolution: {integrity: sha512-ycMEPrS3StOIeb87BT3/+bu+blEtyvwQ4zmo2IcJQy0Rd1DAAhKksA0iUZ3MYSpJtjlPhg0Eo6mvVS6ggPhRbw==} - '@rollup/rollup-android-arm-eabi@4.53.3': - resolution: {integrity: sha512-mRSi+4cBjrRLoaal2PnqH82Wqyb+d3HsPUN/W+WslCXsZsyHa9ZeQQX/pQsZaVIWDkPcpV6jJ+3KLbTbgnwv8w==} + '@rollup/rollup-android-arm-eabi@4.53.1': + resolution: {integrity: sha512-bxZtughE4VNVJlL1RdoSE545kc4JxL7op57KKoi59/gwuU5rV6jLWFXXc8jwgFoT6vtj+ZjO+Z2C5nrY0Cl6wA==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.53.3': - resolution: {integrity: sha512-CbDGaMpdE9sh7sCmTrTUyllhrg65t6SwhjlMJsLr+J8YjFuPmCEjbBSx4Z/e4SmDyH3aB5hGaJUP2ltV/vcs4w==} + '@rollup/rollup-android-arm64@4.53.1': + resolution: {integrity: sha512-44a1hreb02cAAfAKmZfXVercPFaDjqXCK+iKeVOlJ9ltvnO6QqsBHgKVPTu+MJHSLLeMEUbeG2qiDYgbFPU48g==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.53.3': - resolution: {integrity: sha512-Nr7SlQeqIBpOV6BHHGZgYBuSdanCXuw09hon14MGOLGmXAFYjx1wNvquVPmpZnl0tLjg25dEdr4IQ6GgyToCUA==} + '@rollup/rollup-darwin-arm64@4.53.1': + resolution: {integrity: sha512-usmzIgD0rf1syoOZ2WZvy8YpXK5G1V3btm3QZddoGSa6mOgfXWkkv+642bfUUldomgrbiLQGrPryb7DXLovPWQ==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.53.3': - resolution: {integrity: sha512-DZ8N4CSNfl965CmPktJ8oBnfYr3F8dTTNBQkRlffnUarJ2ohudQD17sZBa097J8xhQ26AwhHJ5mvUyQW8ddTsQ==} + '@rollup/rollup-darwin-x64@4.53.1': + resolution: {integrity: sha512-is3r/k4vig2Gt8mKtTlzzyaSQ+hd87kDxiN3uDSDwggJLUV56Umli6OoL+/YZa/KvtdrdyNfMKHzL/P4siOOmg==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.53.3': - resolution: {integrity: sha512-yMTrCrK92aGyi7GuDNtGn2sNW+Gdb4vErx4t3Gv/Tr+1zRb8ax4z8GWVRfr3Jw8zJWvpGHNpss3vVlbF58DZ4w==} + '@rollup/rollup-freebsd-arm64@4.53.1': + resolution: {integrity: sha512-QJ1ksgp/bDJkZB4daldVmHaEQkG4r8PUXitCOC2WRmRaSaHx5RwPoI3DHVfXKwDkB+Sk6auFI/+JHacTekPRSw==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.53.3': - resolution: {integrity: sha512-lMfF8X7QhdQzseM6XaX0vbno2m3hlyZFhwcndRMw8fbAGUGL3WFMBdK0hbUBIUYcEcMhVLr1SIamDeuLBnXS+Q==} + '@rollup/rollup-freebsd-x64@4.53.1': + resolution: {integrity: sha512-J6ma5xgAzvqsnU6a0+jgGX/gvoGokqpkx6zY4cWizRrm0ffhHDpJKQgC8dtDb3+MqfZDIqs64REbfHDMzxLMqQ==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.53.3': - resolution: {integrity: sha512-k9oD15soC/Ln6d2Wv/JOFPzZXIAIFLp6B+i14KhxAfnq76ajt0EhYc5YPeX6W1xJkAdItcVT+JhKl1QZh44/qw==} + '@rollup/rollup-linux-arm-gnueabihf@4.53.1': + resolution: {integrity: sha512-JzWRR41o2U3/KMNKRuZNsDUAcAVUYhsPuMlx5RUldw0E4lvSIXFUwejtYz1HJXohUmqs/M6BBJAUBzKXZVddbg==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.53.3': - resolution: {integrity: sha512-vTNlKq+N6CK/8UktsrFuc+/7NlEYVxgaEgRXVUVK258Z5ymho29skzW1sutgYjqNnquGwVUObAaxae8rZ6YMhg==} + '@rollup/rollup-linux-arm-musleabihf@4.53.1': + resolution: {integrity: sha512-L8kRIrnfMrEoHLHtHn+4uYA52fiLDEDyezgxZtGUTiII/yb04Krq+vk3P2Try+Vya9LeCE9ZHU8CXD6J9EhzHQ==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.53.3': - resolution: {integrity: sha512-RGrFLWgMhSxRs/EWJMIFM1O5Mzuz3Xy3/mnxJp/5cVhZ2XoCAxJnmNsEyeMJtpK+wu0FJFWz+QF4mjCA7AUQ3w==} + '@rollup/rollup-linux-arm64-gnu@4.53.1': + resolution: {integrity: sha512-ysAc0MFRV+WtQ8li8hi3EoFi7us6d1UzaS/+Dp7FYZfg3NdDljGMoVyiIp6Ucz7uhlYDBZ/zt6XI0YEZbUO11Q==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.53.3': - resolution: {integrity: sha512-kASyvfBEWYPEwe0Qv4nfu6pNkITLTb32p4yTgzFCocHnJLAHs+9LjUu9ONIhvfT/5lv4YS5muBHyuV84epBo/A==} + '@rollup/rollup-linux-arm64-musl@4.53.1': + resolution: {integrity: sha512-UV6l9MJpDbDZZ/fJvqNcvO1PcivGEf1AvKuTcHoLjVZVFeAMygnamCTDikCVMRnA+qJe+B3pSbgX2+lBMqgBhA==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.53.3': - resolution: {integrity: sha512-JiuKcp2teLJwQ7vkJ95EwESWkNRFJD7TQgYmCnrPtlu50b4XvT5MOmurWNrCj3IFdyjBQ5p9vnrX4JM6I8OE7g==} + '@rollup/rollup-linux-loong64-gnu@4.53.1': + resolution: {integrity: sha512-UDUtelEprkA85g95Q+nj3Xf0M4hHa4DiJ+3P3h4BuGliY4NReYYqwlc0Y8ICLjN4+uIgCEvaygYlpf0hUj90Yg==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-gnu@4.53.3': - resolution: {integrity: sha512-EoGSa8nd6d3T7zLuqdojxC20oBfNT8nexBbB/rkxgKj5T5vhpAQKKnD+h3UkoMuTyXkP5jTjK/ccNRmQrPNDuw==} + '@rollup/rollup-linux-ppc64-gnu@4.53.1': + resolution: {integrity: sha512-vrRn+BYhEtNOte/zbc2wAUQReJXxEx2URfTol6OEfY2zFEUK92pkFBSXRylDM7aHi+YqEPJt9/ABYzmcrS4SgQ==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-gnu@4.53.3': - resolution: {integrity: sha512-4s+Wped2IHXHPnAEbIB0YWBv7SDohqxobiiPA1FIWZpX+w9o2i4LezzH/NkFUl8LRci/8udci6cLq+jJQlh+0g==} + '@rollup/rollup-linux-riscv64-gnu@4.53.1': + resolution: {integrity: sha512-gto/1CxHyi4A7YqZZNznQYrVlPSaodOBPKM+6xcDSCMVZN/Fzb4K+AIkNz/1yAYz9h3Ng+e2fY9H6bgawVq17w==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.53.3': - resolution: {integrity: sha512-68k2g7+0vs2u9CxDt5ktXTngsxOQkSEV/xBbwlqYcUrAVh6P9EgMZvFsnHy4SEiUl46Xf0IObWVbMvPrr2gw8A==} + '@rollup/rollup-linux-riscv64-musl@4.53.1': + resolution: {integrity: sha512-KZ6Vx7jAw3aLNjFR8eYVcQVdFa/cvBzDNRFM3z7XhNNunWjA03eUrEwJYPk0G8V7Gs08IThFKcAPS4WY/ybIrQ==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.53.3': - resolution: {integrity: sha512-VYsFMpULAz87ZW6BVYw3I6sWesGpsP9OPcyKe8ofdg9LHxSbRMd7zrVrr5xi/3kMZtpWL/wC+UIJWJYVX5uTKg==} + '@rollup/rollup-linux-s390x-gnu@4.53.1': + resolution: {integrity: sha512-HvEixy2s/rWNgpwyKpXJcHmE7om1M89hxBTBi9Fs6zVuLU4gOrEMQNbNsN/tBVIMbLyysz/iwNiGtMOpLAOlvA==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.53.3': - resolution: {integrity: sha512-3EhFi1FU6YL8HTUJZ51imGJWEX//ajQPfqWLI3BQq4TlvHy4X0MOr5q3D2Zof/ka0d5FNdPwZXm3Yyib/UEd+w==} + '@rollup/rollup-linux-x64-gnu@4.53.1': + resolution: {integrity: sha512-E/n8x2MSjAQgjj9IixO4UeEUeqXLtiA7pyoXCFYLuXpBA/t2hnbIdxHfA7kK9BFsYAoNU4st1rHYdldl8dTqGA==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.53.3': - resolution: {integrity: sha512-eoROhjcc6HbZCJr+tvVT8X4fW3/5g/WkGvvmwz/88sDtSJzO7r/blvoBDgISDiCjDRZmHpwud7h+6Q9JxFwq1Q==} + '@rollup/rollup-linux-x64-musl@4.53.1': + resolution: {integrity: sha512-IhJ087PbLOQXCN6Ui/3FUkI9pWNZe/Z7rEIVOzMsOs1/HSAECCvSZ7PkIbkNqL/AZn6WbZvnoVZw/qwqYMo4/w==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-openharmony-arm64@4.53.3': - resolution: {integrity: sha512-OueLAWgrNSPGAdUdIjSWXw+u/02BRTcnfw9PN41D2vq/JSEPnJnVuBgw18VkN8wcd4fjUs+jFHVM4t9+kBSNLw==} + '@rollup/rollup-openharmony-arm64@4.53.1': + resolution: {integrity: sha512-0++oPNgLJHBblreu0SFM7b3mAsBJBTY0Ksrmu9N6ZVrPiTkRgda52mWR7TKhHAsUb9noCjFvAw9l6ZO1yzaVbA==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.53.3': - resolution: {integrity: sha512-GOFuKpsxR/whszbF/bzydebLiXIHSgsEUp6M0JI8dWvi+fFa1TD6YQa4aSZHtpmh2/uAlj/Dy+nmby3TJ3pkTw==} + '@rollup/rollup-win32-arm64-msvc@4.53.1': + resolution: {integrity: sha512-VJXivz61c5uVdbmitLkDlbcTk9Or43YC2QVLRkqp86QoeFSqI81bNgjhttqhKNMKnQMWnecOCm7lZz4s+WLGpQ==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.53.3': - resolution: {integrity: sha512-iah+THLcBJdpfZ1TstDFbKNznlzoxa8fmnFYK4V67HvmuNYkVdAywJSoteUszvBQ9/HqN2+9AZghbajMsFT+oA==} + '@rollup/rollup-win32-ia32-msvc@4.53.1': + resolution: {integrity: sha512-NmZPVTUOitCXUH6erJDzTQ/jotYw4CnkMDjCYRxNHVD9bNyfrGoIse684F9okwzKCV4AIHRbUkeTBc9F2OOH5Q==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.53.3': - resolution: {integrity: sha512-J9QDiOIZlZLdcot5NXEepDkstocktoVjkaKUtqzgzpt2yWjGlbYiKyp05rWwk4nypbYUNoFAztEgixoLaSETkg==} + '@rollup/rollup-win32-x64-gnu@4.53.1': + resolution: {integrity: sha512-2SNj7COIdAf6yliSpLdLG8BEsp5lgzRehgfkP0Av8zKfQFKku6JcvbobvHASPJu4f3BFxej5g+HuQPvqPhHvpQ==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.53.3': - resolution: {integrity: sha512-UhTd8u31dXadv0MopwGgNOBpUVROFKWVQgAg5N1ESyCz8AuBcMqm4AuTjrwgQKGDfoFuz02EuMRHQIw/frmYKQ==} + '@rollup/rollup-win32-x64-msvc@4.53.1': + resolution: {integrity: sha512-rLarc1Ofcs3DHtgSzFO31pZsCh8g05R2azN1q3fF+H423Co87My0R+tazOEvYVKXSLh8C4LerMK41/K7wlklcg==} cpu: [x64] os: [win32] @@ -2774,9 +2774,6 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - csstype@3.2.3: - resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} - cwise-compiler@1.1.3: resolution: {integrity: sha512-WXlK/m+Di8DMMcCjcWr4i+XzcQra9eCdXIJrgh4TUgh0pIS/yJduLxS9JgefsHJ/YVLdgPtXm9r62W92MvanEQ==} @@ -4494,8 +4491,8 @@ packages: robust-predicates@3.0.2: resolution: {integrity: sha512-IXgzBWvWQwE6PrDI05OvmXUIruQTcoMDzRsOd5CDvHCVLcLHMTSYvOK5Cm46kWqlV3yAbuSpBZdJ5oP5OUoStg==} - rollup@4.53.3: - resolution: {integrity: sha512-w8GmOxZfBmKknvdXU1sdM9NHcoQejwF/4mNgj2JuEEdRaHwwF12K7e9eXn1nLZ07ad+du76mkVsyeb2rKGllsA==} + rollup@4.53.1: + resolution: {integrity: sha512-n2I0V0lN3E9cxxMqBCT3opWOiQBzRN7UG60z/WDKqdX2zHUS/39lezBcsckZFsV6fUTSnfqI7kHf60jDAPGKug==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -6498,70 +6495,70 @@ snapshots: '@rolldown/pluginutils@1.0.0-beta.41': {} - '@rollup/rollup-android-arm-eabi@4.53.3': + '@rollup/rollup-android-arm-eabi@4.53.1': optional: true - '@rollup/rollup-android-arm64@4.53.3': + '@rollup/rollup-android-arm64@4.53.1': optional: true - '@rollup/rollup-darwin-arm64@4.53.3': + '@rollup/rollup-darwin-arm64@4.53.1': optional: true - '@rollup/rollup-darwin-x64@4.53.3': + '@rollup/rollup-darwin-x64@4.53.1': optional: true - '@rollup/rollup-freebsd-arm64@4.53.3': + '@rollup/rollup-freebsd-arm64@4.53.1': optional: true - '@rollup/rollup-freebsd-x64@4.53.3': + '@rollup/rollup-freebsd-x64@4.53.1': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.53.3': + '@rollup/rollup-linux-arm-gnueabihf@4.53.1': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.53.3': + '@rollup/rollup-linux-arm-musleabihf@4.53.1': optional: true - '@rollup/rollup-linux-arm64-gnu@4.53.3': + '@rollup/rollup-linux-arm64-gnu@4.53.1': optional: true - '@rollup/rollup-linux-arm64-musl@4.53.3': + '@rollup/rollup-linux-arm64-musl@4.53.1': optional: true - '@rollup/rollup-linux-loong64-gnu@4.53.3': + '@rollup/rollup-linux-loong64-gnu@4.53.1': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.53.3': + '@rollup/rollup-linux-ppc64-gnu@4.53.1': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.53.3': + '@rollup/rollup-linux-riscv64-gnu@4.53.1': optional: true - '@rollup/rollup-linux-riscv64-musl@4.53.3': + '@rollup/rollup-linux-riscv64-musl@4.53.1': optional: true - '@rollup/rollup-linux-s390x-gnu@4.53.3': + '@rollup/rollup-linux-s390x-gnu@4.53.1': optional: true - '@rollup/rollup-linux-x64-gnu@4.53.3': + '@rollup/rollup-linux-x64-gnu@4.53.1': optional: true - '@rollup/rollup-linux-x64-musl@4.53.3': + '@rollup/rollup-linux-x64-musl@4.53.1': optional: true - '@rollup/rollup-openharmony-arm64@4.53.3': + '@rollup/rollup-openharmony-arm64@4.53.1': optional: true - '@rollup/rollup-win32-arm64-msvc@4.53.3': + '@rollup/rollup-win32-arm64-msvc@4.53.1': optional: true - '@rollup/rollup-win32-ia32-msvc@4.53.3': + '@rollup/rollup-win32-ia32-msvc@4.53.1': optional: true - '@rollup/rollup-win32-x64-gnu@4.53.3': + '@rollup/rollup-win32-x64-gnu@4.53.1': optional: true - '@rollup/rollup-win32-x64-msvc@4.53.3': + '@rollup/rollup-win32-x64-msvc@4.53.1': optional: true '@shikijs/core@3.15.0': @@ -7284,7 +7281,7 @@ snapshots: '@vue/reactivity': 3.5.25 '@vue/runtime-core': 3.5.25 '@vue/shared': 3.5.25 - csstype: 3.2.3 + csstype: 3.1.3 '@vue/server-renderer@3.5.25(vue@3.5.25(typescript@5.9.3))': dependencies: @@ -7835,8 +7832,6 @@ snapshots: csstype@3.1.3: {} - csstype@3.2.3: {} - cwise-compiler@1.1.3: dependencies: uniq: 1.0.1 @@ -9644,32 +9639,32 @@ snapshots: robust-predicates@3.0.2: {} - rollup@4.53.3: + rollup@4.53.1: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.53.3 - '@rollup/rollup-android-arm64': 4.53.3 - '@rollup/rollup-darwin-arm64': 4.53.3 - '@rollup/rollup-darwin-x64': 4.53.3 - '@rollup/rollup-freebsd-arm64': 4.53.3 - '@rollup/rollup-freebsd-x64': 4.53.3 - '@rollup/rollup-linux-arm-gnueabihf': 4.53.3 - '@rollup/rollup-linux-arm-musleabihf': 4.53.3 - '@rollup/rollup-linux-arm64-gnu': 4.53.3 - '@rollup/rollup-linux-arm64-musl': 4.53.3 - '@rollup/rollup-linux-loong64-gnu': 4.53.3 - '@rollup/rollup-linux-ppc64-gnu': 4.53.3 - '@rollup/rollup-linux-riscv64-gnu': 4.53.3 - '@rollup/rollup-linux-riscv64-musl': 4.53.3 - '@rollup/rollup-linux-s390x-gnu': 4.53.3 - '@rollup/rollup-linux-x64-gnu': 4.53.3 - '@rollup/rollup-linux-x64-musl': 4.53.3 - '@rollup/rollup-openharmony-arm64': 4.53.3 - '@rollup/rollup-win32-arm64-msvc': 4.53.3 - '@rollup/rollup-win32-ia32-msvc': 4.53.3 - '@rollup/rollup-win32-x64-gnu': 4.53.3 - '@rollup/rollup-win32-x64-msvc': 4.53.3 + '@rollup/rollup-android-arm-eabi': 4.53.1 + '@rollup/rollup-android-arm64': 4.53.1 + '@rollup/rollup-darwin-arm64': 4.53.1 + '@rollup/rollup-darwin-x64': 4.53.1 + '@rollup/rollup-freebsd-arm64': 4.53.1 + '@rollup/rollup-freebsd-x64': 4.53.1 + '@rollup/rollup-linux-arm-gnueabihf': 4.53.1 + '@rollup/rollup-linux-arm-musleabihf': 4.53.1 + '@rollup/rollup-linux-arm64-gnu': 4.53.1 + '@rollup/rollup-linux-arm64-musl': 4.53.1 + '@rollup/rollup-linux-loong64-gnu': 4.53.1 + '@rollup/rollup-linux-ppc64-gnu': 4.53.1 + '@rollup/rollup-linux-riscv64-gnu': 4.53.1 + '@rollup/rollup-linux-riscv64-musl': 4.53.1 + '@rollup/rollup-linux-s390x-gnu': 4.53.1 + '@rollup/rollup-linux-x64-gnu': 4.53.1 + '@rollup/rollup-linux-x64-musl': 4.53.1 + '@rollup/rollup-openharmony-arm64': 4.53.1 + '@rollup/rollup-win32-arm64-msvc': 4.53.1 + '@rollup/rollup-win32-ia32-msvc': 4.53.1 + '@rollup/rollup-win32-x64-gnu': 4.53.1 + '@rollup/rollup-win32-x64-msvc': 4.53.1 fsevents: 2.3.3 roughjs@4.6.6: @@ -10247,7 +10242,7 @@ snapshots: fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.53.3 + rollup: 4.53.1 tinyglobby: 0.2.15 optionalDependencies: '@types/node': 24.10.0 diff --git a/src/components/common/ContextMenu.vue b/src/components/common/ContextMenu.vue index c0ffce23..650116e9 100644 --- a/src/components/common/ContextMenu.vue +++ b/src/components/common/ContextMenu.vue @@ -21,7 +21,7 @@
-
更多
+
{{ t('menu.ctx_menu_more') }}
@@ -132,6 +132,7 @@ import { useContextMenu } from '@/hooks/useContextMenu.ts' import { useViewport } from '@/hooks/useViewport.ts' import { isMobile } from '@/utils/PlatformConstants' +import { useI18n } from 'vue-i18n' type Props = { content?: Record @@ -139,6 +140,7 @@ type Props = { emoji?: any[] specialMenu?: any[] } +const { t } = useI18n() const props = withDefaults(defineProps(), { content: () => ({}), diff --git a/src/hooks/useChatMain.ts b/src/hooks/useChatMain.ts index 66aa1400..354b4751 100644 --- a/src/hooks/useChatMain.ts +++ b/src/hooks/useChatMain.ts @@ -40,6 +40,7 @@ import { detectRemoteFileType, getFilesMeta } from '@/utils/PathUtil' import { isMac, isMobile } from '@/utils/PlatformConstants' import { invokeWithErrorHandler } from '@/utils/TauriInvokeHandler' import { useWindow } from './useWindow' +import { useI18n } from 'vue-i18n' type UseChatMainOptions = { enableGroupNicknameModal?: boolean @@ -53,6 +54,7 @@ type GroupNicknameModalPayload = { } export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = {}) => { + const { t } = useI18n() const { openMsgSession, userUid } = useCommon() const { createWebviewWindow, sendWindowPayload, startRtcCall } = useWindow() const { getLocalVideoPath, checkVideoDownloaded } = useVideoViewer() @@ -185,7 +187,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = const commonMenuList = ref([ { - label: '多选', + label: t('menu.select'), icon: 'list-checkbox', click: () => { chatStore.setMsgMultiChoose(true) @@ -193,7 +195,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = visible: (item: MessageType) => !isNoticeMessage(item) }, { - label: '添加到表情', + label: t('menu.add_sticker'), icon: 'add-expression', click: async (item: MessageType) => { const imageUrl = item.message.body.url || item.message.body.content @@ -208,7 +210,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = } }, { - label: '转发', + label: t('menu.forward'), icon: 'share', click: (item: MessageType) => { if (isMobile()) { @@ -227,14 +229,14 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = // } // }, { - label: '回复', + label: t('menu.reply'), icon: 'reply', click: (item: any) => { useMitt.emit(MittEnum.REPLY_MEG, item) } }, { - label: '撤回', + label: t('menu.recall'), icon: 'corner-down-left', click: async (item: MessageType) => { const msg = { ...item } @@ -284,7 +286,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = ]) const videoMenuList = ref([ { - label: '复制', + label: t('menu.copy'), icon: 'copy', click: (item: MessageType) => { if (isMobile()) { @@ -296,7 +298,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = }, ...commonMenuList.value, { - label: '另存为', + label: t('menu.save_as'), icon: 'Importing', click: async (item: MessageType) => { if (isMobile()) { @@ -312,7 +314,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = }, { - label: isMac() ? '在Finder中显示' : '在文件夹中打开', + label: isMac() ? t('menu.show_in_finder') : t('menu.show_in_folder'), icon: 'file2', click: async (item: MessageType) => { try { @@ -342,7 +344,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = /** 右键消息菜单列表 */ const menuList = ref([ { - label: '复制', + label: t('menu.copy'), icon: 'copy', click: (item: MessageType) => { handleCopy(item.message.body.content, true, item.message.id) @@ -350,7 +352,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = visible: (item: MessageType) => !shouldHideCopy(item) }, { - label: '翻译', + label: t('menu.translate'), icon: 'translate', click: async (item: MessageType) => { const selectedText = getSelectedText(item.message.id) @@ -383,7 +385,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = // 历史记录模式:基础菜单(复制、转发) const baseMenus: OPT.RightMenu[] = [ { - label: '复制', + label: t('menu.copy'), icon: 'copy', click: (item: MessageType) => { const content = item.message.body.url || item.message.body.content @@ -395,14 +397,14 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = if (!disableHistoryActions) { baseMenus.push( { - label: '多选', + label: t('menu.select'), icon: 'list-checkbox', click: () => { chatStore.setMsgMultiChoose(true) } }, { - label: '转发', + label: t('menu.forward'), icon: 'share', click: (item: MessageType) => { handleForward(item) @@ -427,7 +429,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = // } // }, { - label: '另存为', + label: t('menu.save_as'), icon: 'Importing', click: async (item: MessageType) => { if (isMobile()) { @@ -453,7 +455,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = }, { - label: isMac() ? '在Finder中显示' : '打开文件夹', + label: isMac() ? t('menu.show_in_finder') : t('menu.open_folder'), icon: 'file2', click: async (item: RightMouseMessageItem) => { console.log('打开文件夹的item项:', item) @@ -511,7 +513,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = // 正常聊天模式:只显示删除 return [ { - label: '删除', + label: t('menu.del'), icon: 'delete', click: (item: any) => { tips.value = '删除后将不会出现在你的消息记录中,确定删除吗?' @@ -527,7 +529,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = /** 文件类型右键菜单 */ const fileMenuList = ref([ { - label: '预览', + label: t('menu.preview'), icon: 'preview-open', click: (item: RightMouseMessageItem) => { console.log('预览文件的参数:', item) @@ -637,7 +639,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = }, ...commonMenuList.value, { - label: '另存为', + label: t('save_as'), icon: 'Importing', click: async (item: RightMouseMessageItem) => { if (isMobile()) { @@ -653,7 +655,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = }, { - label: isMac() ? '在Finder中显示' : '打开文件夹', + label: isMac() ? t('menu.show_in_finder') : t('menu.open_folder'), icon: 'file2', click: async (item: RightMouseMessageItem) => { console.log('打开文件夹的item项:', item) @@ -706,7 +708,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = /** 图片类型右键菜单 */ const imageMenuList = ref([ { - label: '复制', + label: t('menu.copy'), icon: 'copy', click: async (item: MessageType) => { // 对于图片消息,优先使用 url 字段,回退到 content 字段 @@ -716,7 +718,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = }, ...commonMenuList.value, { - label: '另存为', + label: t('menu.save_as'), icon: 'Importing', click: async (item: MessageType) => { if (isMobile()) { @@ -748,7 +750,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = } }, { - label: isMac() ? '在Finder中显示' : '打开文件夹', + label: isMac() ? t('menu.show_in_finder') : t('menu.open_folder'), icon: 'file2', click: async (item: MessageType) => { const fileUrl = item.message.body.url || item.message.body.content @@ -798,7 +800,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = /** 右键用户信息菜单(群聊的时候显示) */ const optionsList = ref([ { - label: '发送信息', + label: t('menu.send_message'), icon: 'message-action', click: (item: any) => { openMsgSession(item.uid || item.fromUser.uid) @@ -814,7 +816,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = visible: (item: any) => (item.uid ? item.uid !== userUid.value : item.fromUser.uid !== userUid.value) }, { - label: '查看资料', + label: t('menu.get_user_info'), icon: 'notes', click: (item: any, type: string) => { // 如果是聊天框内的资料就使用的是消息的key,如果是群聊成员的资料就使用的是uid @@ -823,7 +825,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = } }, { - label: '修改群昵称', + label: t('menu.modify_group_nickname'), icon: 'edit', click: (item: any) => { const targetUid = item.uid || item.fromUser?.uid @@ -847,7 +849,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = visible: (item: any) => (item.uid ? item.uid === userUid.value : item.fromUser.uid === userUid.value) }, { - label: '添加好友', + label: t('menu.add_friend'), icon: 'people-plus', click: async (item: any) => { await createWebviewWindow('申请加好友', 'addFriendVerify', 380, 300, '', false, 380, 300) @@ -1003,7 +1005,7 @@ export const useChatMain = (isHistoryMode = false, options: UseChatMainOptions = } }, { - label: '举报', + label: t('menu.report'), icon: 'caution', click: () => {} } diff --git a/src/layout/center/index.vue b/src/layout/center/index.vue index c4d49a19..74361ac4 100644 --- a/src/layout/center/index.vue +++ b/src/layout/center/index.vue @@ -31,7 +31,7 @@ id="search" v-model:value="searchText" @focus="() => handleSearchFocus()" - @blur="() => (searchText = '搜索')" + @blur="() => (searchText = t('home.search_input_placeholder'))" @update:value="handleSearchInputChange" class="rounded-6px w-full relative text-12px" style="background: var(--search-bg-color)" @@ -42,7 +42,7 @@ autoCorrect="off" autoCapitalize="off" size="small" - :placeholder="isSearchMode ? '' : '搜索'"> + :placeholder="isSearchMode ? '' : t('home.search_input_placeholder')"> @@ -140,7 +140,9 @@ import { useSettingStore } from '@/stores/setting.ts' import * as ImRequestUtils from '@/utils/ImRequestUtils' import { isMac, isWindows } from '@/utils/PlatformConstants' import { options, renderLabel, renderSourceList, renderTargetList } from './model.tsx' +import { useI18n } from 'vue-i18n' +const { t } = useI18n() const { createWebviewWindow } = useWindow() const chatStore = useChatStore() @@ -164,7 +166,7 @@ const { width } = useWindowSize() /** 是否拖拽 */ const isDrag = ref(true) /** 搜索框文字 */ -const searchText = ref('搜索') +const searchText = ref(t('home.search_input_placeholder')) /** 是否处于搜索模式 */ const isSearchMode = ref(false) /** 添加面板是否显示 */ diff --git a/src/stores/menuTop.ts b/src/stores/menuTop.ts index b377bddb..0636eb1b 100644 --- a/src/stores/menuTop.ts +++ b/src/stores/menuTop.ts @@ -1,24 +1,26 @@ import { defineStore } from 'pinia' import { type PluginEnum, StoresEnum } from '@/enums' +import { useI18n } from 'vue-i18n' export const useMenuTopStore = defineStore( StoresEnum.MENUTOP, () => { + const { t } = useI18n() // 初始状态 const initialState: OPT.L.Common[] = [ { url: 'message', icon: 'message', iconAction: 'message-action', - title: '消息列表', - shortTitle: '消息' + title: t('home.action.message'), + shortTitle: t('home.action.message_short_title') }, { url: 'friendsList', icon: 'avatar', iconAction: 'avatar-action', - title: '好友列表', - shortTitle: '好友' + title: t('home.action.contact'), + shortTitle: t('home.action.contact_short_title') } ] diff --git a/src/views/homeWindow/SearchDetails.vue b/src/views/homeWindow/SearchDetails.vue index e270de1e..be4147c0 100644 --- a/src/views/homeWindow/SearchDetails.vue +++ b/src/views/homeWindow/SearchDetails.vue @@ -3,7 +3,7 @@