From aeae0c65bb1d083a70a9d3f95e973264e4944ad4 Mon Sep 17 00:00:00 2001 From: viarotel Date: Tue, 24 Oct 2023 18:59:56 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=F0=9F=93=9D=20=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 2 +- src/App.vue | 6 +- src/components/Device/ControlBar/index.vue | 16 +-- src/components/Device/Remark/index.vue | 4 +- src/components/Device/index.vue | 72 ++++++---- src/locales/en_US.json | 129 +++++++++++++++++- src/locales/zh_CN.json | 147 +++++++++++++++++---- src/main.js | 4 +- 8 files changed, 308 insertions(+), 72 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6e2cf5cc..2d4323ad 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -34,5 +34,5 @@ "dist-release/win-arm64-unpacked/locales", "dist-release/win-unpacked/locales" ], - "i18n-ally.sourceLanguage": "en" + "i18n-ally.sourceLanguage": "zh" } diff --git a/src/App.vue b/src/App.vue index 8dcd5bf7..d2e7da0d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -34,15 +34,15 @@ export default { return { tabsModel: [ { - label: this.$t('devices'), + label: this.$t('devices.name'), prop: 'Device', }, { - label: this.$t('preferences'), + label: this.$t('preferences.name'), prop: 'Preference', }, { - label: this.$t('about'), + label: this.$t('about.name'), prop: 'About', }, ], diff --git a/src/components/Device/ControlBar/index.vue b/src/components/Device/ControlBar/index.vue index 09071d6e..6bf2f391 100644 --- a/src/components/Device/ControlBar/index.vue +++ b/src/components/Device/ControlBar/index.vue @@ -36,46 +36,46 @@ export default { return { controlModel: [ { - label: '切换键', + label: this.$t('devices.operates.switch'), elIcon: 'Switch', command: 'input keyevent KEYCODE_APP_SWITCH', }, { - label: '主屏幕键', + label: this.$t('devices.operates.home'), elIcon: 'HomeFilled', command: 'input keyevent KEYCODE_HOME', }, { - label: '返回键', + label: this.$t('devices.operates.return'), elIcon: 'Back', command: 'input keyevent KEYCODE_BACK', }, { - label: '通知栏', + label: this.$t('devices.operates.notification'), elIcon: 'Notification', command: 'cmd statusbar expand-notifications', tips: '打开下拉菜单选项', }, { - label: '电源键', + label: this.$t('devices.operates.power'), elIcon: 'SwitchButton', command: 'input keyevent KEYCODE_POWER', tips: '可以用来开启或关闭屏幕', }, { - label: '重启设备', + label: this.$t('devices.operates.reboot'), elIcon: 'RefreshLeft', command: 'reboot', tips: '可以用来开启或关闭屏幕', }, { - label: '截取屏幕', + label: this.$t('devices.operates.capture'), elIcon: 'Crop', handle: this.handleScreenCap, tips: '', }, { - label: '安装应用', + label: this.$t('devices.operates.install'), svgIcon: 'install', handle: this.handleInstall, tips: '', diff --git a/src/components/Device/Remark/index.vue b/src/components/Device/Remark/index.vue index 39afeba6..bc585506 100644 --- a/src/components/Device/Remark/index.vue +++ b/src/components/Device/Remark/index.vue @@ -11,7 +11,9 @@ - {{ device.$remark || "备注" }} + {{ + device.$remark || $t("devices.device.remark") + }} diff --git a/src/components/Device/index.vue b/src/components/Device/index.vue index 3a388288..1fa9d85f 100644 --- a/src/components/Device/index.vue +++ b/src/components/Device/index.vue @@ -8,7 +8,7 @@ clearable >
@@ -30,7 +30,7 @@ :loading="connectLoading" @click="handleConnect" > - 连接设备 + {{ $t("devices.wireless.connect") }} - 刷新设备 + {{ $t("devices.refresh") }} - 重启服务 + {{ $t("devices.restart") }}