From bcf892ca37cb4d36dc54b77f8cbd7f8f14b07fd3 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:23:32 +0800 Subject: [PATCH] add translation for bulk action and script execute --- .../app/widgets/bulk_actions/abstract_bulk_action.js | 3 ++- src/public/app/widgets/bulk_actions/execute_script.js | 9 +++++---- src/public/translations/cn/translation.json | 11 ++++++++++- src/public/translations/en/translation.json | 9 +++++++++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/public/app/widgets/bulk_actions/abstract_bulk_action.js b/src/public/app/widgets/bulk_actions/abstract_bulk_action.js index 6bb01d256..634f3d073 100644 --- a/src/public/app/widgets/bulk_actions/abstract_bulk_action.js +++ b/src/public/app/widgets/bulk_actions/abstract_bulk_action.js @@ -1,3 +1,4 @@ +import { t } from "../../services/i18n.js"; import server from "../../services/server.js"; import ws from "../../services/ws.js"; import utils from "../../services/utils.js"; @@ -14,7 +15,7 @@ export default class AbstractBulkAction { $rendered.find('.action-conf-del') .on('click', () => this.deleteAction()) - .attr('title', 'Remove this search action'); + .attr('title', t('abstract_bulk_action.remove_this_search_action')); utils.initHelpDropdown($rendered); diff --git a/src/public/app/widgets/bulk_actions/execute_script.js b/src/public/app/widgets/bulk_actions/execute_script.js index 69d8e3cd9..7adf39968 100644 --- a/src/public/app/widgets/bulk_actions/execute_script.js +++ b/src/public/app/widgets/bulk_actions/execute_script.js @@ -1,10 +1,11 @@ +import { t } from "../../services/i18n.js"; import SpacedUpdate from "../../services/spaced_update.js"; import AbstractBulkAction from "./abstract_bulk_action.js"; const TPL = ` - Execute script: + ${t('execute_script.execute_script')} diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 784278a23..fec3bb61f 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -395,11 +395,20 @@ "help_text_body1": "要添加标签,只需输入例如 #rock 或者如果您还想添加值,则例如 #year = 2020", "help_text_body2": "对于关系,请输入 ~author = @,这将显示一个自动完成列表,您可以查找所需的笔记。", "help_text_body3": "您也可以使用右侧的 + 按钮添加标签和关系。

", - "save_attributes": "报错属性 ", + "save_attributes": "保存属性 ", "add_a_new_attribute": "添加新属性", "add_new_label": "添加新标签 ", "add_new_relation": "添加新关系 ", "add_new_label_definition": "添加新标签定义", "add_new_relation_definition": "添加新关系定义" + }, + "abstract_bulk_action": { + "remove_this_search_action": "删除此搜索操作" + }, + "execute_script": { + "execute_script": "执行脚本", + "help_text": "您可以在匹配的笔记上执行简单的脚本。", + "example_1": "例如,要在笔记标题后附加字符串,请使用以下脚本:", + "example_2": "更复杂的例子,删除所有匹配的笔记属性:" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index 4b8ea4ef6..f7a68f5d1 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -401,5 +401,14 @@ "add_new_relation": "Add new relation ", "add_new_label_definition": "Add new label definition", "add_new_relation_definition": "Add new relation definition" + }, + "abstract_bulk_action": { + "remove_this_search_action": "Remove this search action" + }, + "execute_script": { + "execute_script": "Execute script", + "help_text": "You can execute simple scripts on the matched notes.", + "example_1": "For example to append a string to a note's title, use this small script:", + "example_2": "More complex example would be deleting all matched note's attributes:" } }