From b0fa41e74aa5166cc432e685a9d75a857e4fa383 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Mon, 19 Feb 2024 17:22:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=85=E8=AF=95=20i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/markdown/tui-editor.vue | 10 +++++----- frontend/src/i18n/locales/en.json | 5 +++++ frontend/src/i18n/locales/zh-CN.json | 5 +++++ 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/frontend/src/components/markdown/tui-editor.vue b/frontend/src/components/markdown/tui-editor.vue index d699920..1fe472a 100644 --- a/frontend/src/components/markdown/tui-editor.vue +++ b/frontend/src/components/markdown/tui-editor.vue @@ -44,7 +44,7 @@ const chartOptions = { maxHeight: 300 }; -const {locale} = useI18n() +const {t, locale} = useI18n() const editorRef = ref() @@ -108,7 +108,7 @@ const ctx = reactive({ function openFile(){ OpenFileDialog({ - title: "打开 markdown 文件", + title: `${t("general.open")} markdown ${t("general.file")}`, filters: [ { displayName: "Markdown", @@ -130,7 +130,7 @@ function openFile(){ function saveFile(){ SaveFileDialog({ - title: "保存 markdown", + title: `${t("general.save")} markdown`, filters: [ { displayName: "Markdown", @@ -162,8 +162,8 @@ function saveFile(){ diff --git a/frontend/src/i18n/locales/en.json b/frontend/src/i18n/locales/en.json index 2ed5c95..8c07f87 100644 --- a/frontend/src/i18n/locales/en.json +++ b/frontend/src/i18n/locales/en.json @@ -28,5 +28,10 @@ "global": { "not-supported": "Because it is a beta version, it can't be done for the time being, it will be completed later.", "click-link": "The currently clicked link is: " + }, + "general": { + "open": "open", + "save": "save", + "file": "file" } } diff --git a/frontend/src/i18n/locales/zh-CN.json b/frontend/src/i18n/locales/zh-CN.json index a02258d..4694070 100644 --- a/frontend/src/i18n/locales/zh-CN.json +++ b/frontend/src/i18n/locales/zh-CN.json @@ -28,5 +28,10 @@ "global": { "not-supported": "由于是测试版,所以暂时做不了,后续会完成它。", "click-link": "当前点击的链接是: " + }, + "general": { + "open": "打开", + "save": "保存", + "file": "文件" } }