Преглед изворни кода

feat(i18n): add English translations for machine management page

- Fill in all empty English translations in en.json
- Add translations for table headers: Machine ID, Name, Location, etc.
- Add translations for actions: Edit, Delete, Search, Reset, Add
- Add translations for messages: success/error messages
- Fix useI18n to use global scope for proper translation loading

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
yb пре 2 недеља
родитељ
комит
735e6683af
2 измењених фајлова са 36 додато и 36 уклоњено
  1. 35 35
      src/locales/en.json
  2. 1 1
      src/views/machine/index.vue

+ 35 - 35
src/locales/en.json

@@ -1,20 +1,20 @@
 {
   "版本": "Version",
   "保存配置": "Save Configuration",
-  "编辑": "",
-  "编辑机器": "",
+  "编辑": "Edit",
+  "编辑机器": "Edit Machine",
   "播放": "Play",
   "播放测试视频": "Play Test Video",
   "播放方式": "Playback Method",
   "播放器类型": "Player Type",
   "播放域名的子域名部分": "The subdomain part of the playback domain",
-  "操作": "",
+  "操作": "Actions",
   "测试播放": "Test Playback",
   "测试连接": "Test Connection",
   "测试视频": "Test Video",
-  "查询": "",
-  "成功删除": "",
-  "创建时间": "",
+  "查询": "Search",
+  "成功删除": "Successfully deleted",
+  "创建时间": "Created At",
   "当前状态": "Current Status",
   "登录": "Sign In",
   "登录成功": "Login successful",
@@ -29,7 +29,7 @@
   "获取统计数据失败": "Failed to get statistics",
   "机器管理": "Machine Management",
   "机器总数": "Total Machines",
-  "机器ID": "",
+  "机器ID": "Machine ID",
   "记住我": "Remember me",
   "技术支持": "Support",
   "截图": "Screenshot",
@@ -40,21 +40,21 @@
   "快速测试": "Quick Test",
   "离线": "Offline",
   "两次输入的密码不一致": "The passwords entered twice do not match",
-  "吗?": "",
+  "吗?": "?",
   "密码": "Password",
   "密码长度不能少于6位": "Password length must be at least 6 characters",
-  "描述": "",
-  "名称": "",
+  "描述": "Description",
+  "名称": "Name",
   "配置说明": "Configuration Description",
-  "批量删除": "",
-  "批量删除失败": "",
-  "启用": "",
-  "启用状态": "",
+  "批量删除": "Batch Delete",
+  "批量删除失败": "Batch delete failed",
+  "启用": "Enabled",
+  "启用状态": "Status",
   "清空": "Clear",
   "请联系管理员重置密码": "Please contact the administrator to reset your password",
-  "请输入机器ID": "",
+  "请输入机器ID": "Please enter Machine ID",
   "请输入密码": "Please enter password",
-  "请输入名称": "",
+  "请输入名称": "Please enter name",
   "请输入视频地址并点击播放": "Please enter video URL and click play",
   "请输入新密码": "Please enter the new password",
   "请输入用户名": "Please enter username",
@@ -62,19 +62,19 @@
   "请选择视频源并点击播放": "Please select video source and click play",
   "请再次输入新密码": "Please enter the new password again",
   "取消": "Cancel",
-  "取消选择": "",
+  "取消选择": "Clear Selection",
   "全屏": "Fullscreen",
   "确定": "Confirm",
-  "确定要删除机器": "",
-  "确定要删除选中的": "",
+  "确定要删除机器": "Are you sure you want to delete machine",
+  "确定要删除选中的": "Are you sure you want to delete the selected",
   "确认密码": "Confirm Password",
   "如何获取 Customer Subdomain": "How to get Customer Subdomain",
-  "删除": "",
-  "删除成功": "",
-  "删除失败": "",
+  "删除": "Delete",
+  "删除成功": "Deleted successfully",
+  "删除失败": "Delete failed",
   "摄像头管理": "Camera Management",
   "摄像头管理系统": "Camera Management",
-  "摄像头数": "",
+  "摄像头数": "Cameras",
   "摄像头在线率": "Camera Online Rate",
   "摄像头总数": "Total Cameras",
   "生成地址": "Generate URL",
@@ -86,32 +86,32 @@
   "手动": "Manual",
   "数据更新时间": "Last Updated",
   "刷新数据": "Refresh",
-  "台机器": "",
-  "台机器吗?": "",
-  "提示": "",
+  "台机器": "machines",
+  "台机器吗?": "machines?",
+  "提示": "Notice",
   "停止": "Stop",
   "通道总数": "Total Channels",
   "推荐通过后端代理调用,避免暴露 Token": "Recommended to call through the backend proxy to avoid exposing the Token",
   "退出登录": "Logout",
   "忘记密码?": "Forgot password?",
-  "位置": "",
+  "位置": "Location",
   "稳定性": "Uptime",
   "系统信息": "System Info",
   "系统运行正常": "System running normally",
   "系统状态": "System Status",
-  "项": "",
+  "项": "items",
   "新建标签": "New Tab",
   "新密码": "New Password",
-  "新增": "",
-  "新增成功": "",
-  "新增机器": "",
-  "修改成功": "",
+  "新增": "Add",
+  "新增成功": "Added successfully",
+  "新增机器": "Add Machine",
+  "修改成功": "Updated successfully",
   "修改密码": "Change Password",
   "选择测试源": "Select Test Source",
   "仪表盘": "Dashboard",
   "已禁用": "Disabled",
   "已启用": "Enabled",
-  "已选择": "",
+  "已选择": "Selected",
   "用户": "Users",
   "用户名": "Username",
   "有声": "Sound",
@@ -122,14 +122,14 @@
   "正常": "Normal",
   "直接 URL": "Direct URL",
   "直接 URL 播放": "Direct URL Playback",
-  "重置": "",
+  "重置": "Reset",
   "转换服务地址": "Proxy Service URL",
   "自定义域名": "Custom Domain",
   "自动播放": "Autoplay",
   "Cloudflare Stream": "Cloudflare Stream",
   "Cloudflare Stream 配置": "Cloudflare Stream Configuration",
   "iframe 模式": "iframe Mode",
-  "RTSP 地址": "",
+  "RTSP 地址": "RTSP URL",
   "RTSP 流": "RTSP Stream",
   "RTSP 流需要通过服务端转换为 HLS/WebRTC 后才能在浏览器播放": "RTSP streams need to be converted to HLS/WebRTC via server before playing in browser",
   "Stream 测试": "Stream Test",

+ 1 - 1
src/views/machine/index.vue

@@ -186,7 +186,7 @@ import type { MachineDTO, MachineAddRequest, MachineUpdateRequest } from '@/type
 import dayjs from 'dayjs'
 import { useI18n } from 'vue-i18n'
 
-const { t } = useI18n()
+const { t } = useI18n({ useScope: 'global' })
 
 // 格式化时间
 function formatDateTime(dateStr: string | undefined): string {