diff --git a/src/components/Sidebar.vue b/src/components/Sidebar.vue index 6da90af..c169f44 100644 --- a/src/components/Sidebar.vue +++ b/src/components/Sidebar.vue @@ -25,7 +25,9 @@ import { AndroidMetastate, } from "../frontcommand/android"; import { ref } from "vue"; +import { useI18n } from "vue-i18n"; +const { t } = useI18n(); const router = useRouter(); const route = useRoute(); const store = useGlobalStore(); @@ -61,7 +63,7 @@ async function sendKeyCodeToDevice(code: AndroidKeycode) { metastate: AndroidMetastate.AMETA_NONE, }); } else { - message.error("未连接设备"); + message.error(t("sidebar.noControledDevice")); } } @@ -70,7 +72,7 @@ async function changeScreenPowerMode() { sendSetScreenPowerMode({ mode: nextScreenPowerMode.value }); nextScreenPowerMode.value = nextScreenPowerMode.value ? 0 : 2; } else { - message.error("未连接设备"); + message.error(t("sidebar.noControledDevice")); } } diff --git a/src/components/setting/About.vue b/src/components/setting/About.vue index 6dd05af..f093890 100644 --- a/src/components/setting/About.vue +++ b/src/components/setting/About.vue @@ -28,11 +28,8 @@ async function checkUpdate() { - Github repo + {{ $t("pages.Setting.About.github") }} - AkiChase's Blog + {{ $t("pages.Setting.About.blog") }} - 更新 + {{ $t("pages.Setting.About.update") }} 启动时检查软件更新{{ $t("pages.Setting.About.checkUpdateOnStartup") }} - 当前版本:{{ appVersion }} - 检查更新 + {{ $t("pages.Setting.About.curVersion", [appVersion]) }} + {{ + $t("pages.Setting.About.checkUpdate") + }} diff --git a/src/components/setting/Basic.vue b/src/components/setting/Basic.vue index 044fe2f..51024e7 100644 --- a/src/components/setting/Basic.vue +++ b/src/components/setting/Basic.vue @@ -18,7 +18,9 @@ import { import { relaunch } from "@tauri-apps/plugin-process"; import { onMounted, ref } from "vue"; import i18n from "../../i18n"; +import { useI18n } from "vue-i18n"; +const { t } = useI18n(); const localStore = new Store("store.bin"); const dialog = useDialog(); @@ -56,10 +58,10 @@ function showLocalStore(index: number) { function delLocalStore(key?: string) { if (key) { dialog.warning({ - title: "Warning", - content: `即将删除数据"${key}",删除操作不可撤回,是否继续?`, - positiveText: "删除", - negativeText: "取消", + title: t("pages.Setting.Basic.delLocalStore.dialog.title"), + content: t("pages.Setting.Basic.delLocalStore.dialog.delKey", [key]), + positiveText: t("pages.Setting.Basic.delLocalStore.dialog.positiveText"), + negativeText: t("pages.Setting.Basic.delLocalStore.dialog.negativeText"), onPositiveClick: () => { localStore.delete(key); localStoreEntries.value.splice(curDataIndex, 1); @@ -68,12 +70,12 @@ function delLocalStore(key?: string) { }); } else { dialog.warning({ - title: "Warning", - content: "即将清空数据,操作不可撤回,且清空后将重启软件,是否继续?", - positiveText: "删除", - negativeText: "取消", + title: t("pages.Setting.Basic.delLocalStore.dialog.title"), + content: t("pages.Setting.Basic.delLocalStore.dialog.delAll"), + positiveText: t("pages.Setting.Basic.delLocalStore.dialog.positiveText"), + negativeText: t("pages.Setting.Basic.delLocalStore.dialog.negativeText"), onPositiveClick: () => { - // localStore.clear(); + localStore.clear(); relaunch(); }, }); @@ -90,7 +92,7 @@ function changeLanguage(language: "zh-CN" | "en-US") {