From 6999389a6d0a05336e83ee1dacfbf1bb2827d145 Mon Sep 17 00:00:00 2001 From: situ2001 Date: Tue, 13 Dec 2022 22:39:57 +0800 Subject: [PATCH] chore: translation for error msg of `validate-existing-file` --- src/main/frontend/dicts.cljc | 4 +++- src/main/frontend/handler/common/file.cljs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/frontend/dicts.cljc b/src/main/frontend/dicts.cljc index 84c510b0f0..62c52e02f3 100644 --- a/src/main/frontend/dicts.cljc +++ b/src/main/frontend/dicts.cljc @@ -132,6 +132,7 @@ :file/last-modified-at "Last modified at" :file/no-data "No data" :file/format-not-supported "Format .{1} is not supported." + :file/validate-existing-file-error "Page already exists with another file: {1}, current file: {2}. Please keep only one of them and re-index your graph." :file-rn/re-index "Re-index is strongly recommended after the files are renamed and on other devices after syncing." :file-rn/need-action "File rename actions are suggested to match the new format. Re-index is required on all devices when the renamed files are synced." :file-rn/or-select-actions " or individually rename files below, then " @@ -1584,7 +1585,8 @@ :file/name "文件名" :file/file "文件:" :file/last-modified-at "最后更改于" - :file/no-data "没有数据" + :file/no-data "没有数据" + :file/validate-existing-file-error "页面已存在另一个文件: {1}, 当前文件: {2}. 请保留其中一个文件,然后重建当前图谱的索引。" :file-rn/re-index "重命名文件后,如果其他设备同步了改文件,强烈建议在同步成功后重新建立索引。" :file-rn/need-action "建议执行文件重命名操作以匹配新格式。当重命名的文件被同步后,请在所有设备上重新建立索引。" :file-rn/or-select-actions " 或在下面单独重命名这些文件,然后 " diff --git a/src/main/frontend/handler/common/file.cljs b/src/main/frontend/handler/common/file.cljs index 5e3a8ee426..0c073ca8e4 100644 --- a/src/main/frontend/handler/common/file.cljs +++ b/src/main/frontend/handler/common/file.cljs @@ -9,7 +9,8 @@ [logseq.graph-parser :as graph-parser] [logseq.graph-parser.util :as gp-util] [logseq.graph-parser.config :as gp-config] - [frontend.fs.capacitor-fs :as capacitor-fs])) + [frontend.fs.capacitor-fs :as capacitor-fs] + [frontend.context.i18n :refer [t]])) (defn- page-exists-in-another-file "Conflict of files towards same page" @@ -23,7 +24,7 @@ [repo-url file-page file-path] (when-let [current-file (page-exists-in-another-file repo-url file-page file-path)] (when (not= file-path current-file) - (let [error (str "Page already exists with another file: " current-file ", current file: " file-path ". Please keep only one of them and re-index your graph.")] + (let [error (t :file/validate-existing-file-error current-file file-path)] (state/pub-event! [:notification/show {:content error :status :error