From 738684c4c728dd3afb5642a6603b25145679cb88 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Mon, 29 Jul 2024 10:37:53 +0800 Subject: [PATCH] add translation for bulk action of labels --- .../widgets/bulk_actions/label/add_label.js | 19 +++++------ .../bulk_actions/label/delete_label.js | 7 ++-- .../bulk_actions/label/rename_label.js | 13 ++++---- .../bulk_actions/label/update_label_value.js | 15 +++++---- src/public/translations/cn/translation.json | 32 +++++++++++++++++++ src/public/translations/en/translation.json | 32 +++++++++++++++++++ 6 files changed, 93 insertions(+), 25 deletions(-) diff --git a/src/public/app/widgets/bulk_actions/label/add_label.js b/src/public/app/widgets/bulk_actions/label/add_label.js index 8e120e0ce..83782038a 100644 --- a/src/public/app/widgets/bulk_actions/label/add_label.js +++ b/src/public/app/widgets/bulk_actions/label/add_label.js @@ -1,3 +1,4 @@ +import { t } from "../../../services/i18n.js"; import SpacedUpdate from "../../../services/spaced_update.js"; import AbstractBulkAction from "../abstract_bulk_action.js"; @@ -5,31 +6,31 @@ const TPL = `
-
Add label
+
${t("add_label.add_label")}
+ title="${t("add_label.label_name_title")}"/> -
to value
+
${t("add_label.to_value")}
- +
diff --git a/src/public/app/widgets/bulk_actions/label/delete_label.js b/src/public/app/widgets/bulk_actions/label/delete_label.js index 76490ca56..003d1db94 100644 --- a/src/public/app/widgets/bulk_actions/label/delete_label.js +++ b/src/public/app/widgets/bulk_actions/label/delete_label.js @@ -1,17 +1,18 @@ +import { t } from "../../../services/i18n.js"; import SpacedUpdate from "../../../services/spaced_update.js"; import AbstractBulkAction from "../abstract_bulk_action.js"; const TPL = ` - Delete label: + ${t("delete_label.delete_label")} + title="${t("delete_label.label_name_title")}" + placeholder="${t("delete_label.label_name_placeholder")}"/> diff --git a/src/public/app/widgets/bulk_actions/label/rename_label.js b/src/public/app/widgets/bulk_actions/label/rename_label.js index ec66dede0..7b5304e1f 100644 --- a/src/public/app/widgets/bulk_actions/label/rename_label.js +++ b/src/public/app/widgets/bulk_actions/label/rename_label.js @@ -1,3 +1,4 @@ +import { t } from "../../../services/i18n.js"; import SpacedUpdate from "../../../services/spaced_update.js"; import AbstractBulkAction from "../abstract_bulk_action.js"; @@ -5,21 +6,21 @@ const TPL = `
-
Rename label from:
+
${t("rename_label.rename_label_from")}
+ title="${t("rename_label.name_title")}"/> -
To:
+
${t("rename_label.to")}
+ title="${t("rename_label.name_title")}"/>
diff --git a/src/public/app/widgets/bulk_actions/label/update_label_value.js b/src/public/app/widgets/bulk_actions/label/update_label_value.js index 3a0829fff..0f65fbeb8 100644 --- a/src/public/app/widgets/bulk_actions/label/update_label_value.js +++ b/src/public/app/widgets/bulk_actions/label/update_label_value.js @@ -1,3 +1,4 @@ +import { t } from "../../../services/i18n.js"; import SpacedUpdate from "../../../services/spaced_update.js"; import AbstractBulkAction from "../abstract_bulk_action.js"; @@ -5,26 +6,26 @@ const TPL = `
-
Update label value
+
${t("update_label_value.update_label_value")}
+ title="${t("update_label_value.label_name_title")}"/> -
to value
+
${t("update_label_value.to_value")}
- +
diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index fec3bb61f..8b79dd240 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -410,5 +410,37 @@ "help_text": "您可以在匹配的笔记上执行简单的脚本。", "example_1": "例如,要在笔记标题后附加字符串,请使用以下脚本:", "example_2": "更复杂的例子,删除所有匹配的笔记属性:" + }, + "add_label": { + "add_label": "添加标签", + "label_name_placeholder": "标签名称", + "label_name_title": "允许使用字母、数字、下划线和冒号。", + "to_value": "值为", + "new_value_placeholder": "新值", + "help_text": "在所有匹配的笔记上:", + "help_text_item1": "如果笔记尚无此标签,则创建给定的标签", + "help_text_item2": "或更改现有标签的值", + "help_text_note": "您也可以在不指定值的情况下调用此方法,这种情况下,标签将分配给没有值的笔记。" + }, + "delete_label": { + "delete_label": "删除标签", + "label_name_placeholder": "标签名称", + "label_name_title": "允许使用字母、数字、下划线和冒号。" + }, + "rename_label": { + "rename_label_from": "重命名标签从", + "old_name_placeholder": "旧名称", + "to": "改为", + "new_name_placeholder": "新名称", + "name_title": "允许使用字母、数字、下划线和冒号。" + }, + "update_label_value": { + "update_label_value": "更新标签值", + "label_name_placeholder": "标签名称", + "label_name_title": "允许使用字母、数字、下划线和冒号。", + "to_value": "值为", + "new_value_placeholder": "新值", + "help_text": "在所有匹配的笔记上,更改现有标签的值。", + "help_text_note": "您也可以在不指定值的情况下调用此方法,这种情况下,标签将分配给没有值的笔记。" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index f7a68f5d1..fab8c82e0 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -410,5 +410,37 @@ "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:" + }, + "add_label": { + "add_label": "Add label", + "label_name_placeholder": "label name", + "label_name_title": "Alphanumeric characters, underscore and colon are allowed characters.", + "to_value": "to value", + "new_value_placeholder": "new value", + "help_text": "On all matched notes:", + "help_text_item1": "create given label if note doesn't have one yet", + "help_text_item2": "or change value of the existing label", + "help_text_note": "You can also call this method without value, in such case label will be assigned to the note without value." + }, + "delete_label": { + "delete_label": "Delete label", + "label_name_placeholder": "label name", + "label_name_title": "Alphanumeric characters, underscore and colon are allowed characters." + }, + "rename_label": { + "rename_label_from": "Rename label from", + "old_name_placeholder": "old name", + "to": "To", + "new_name_placeholder": "new name", + "name_title": "Alphanumeric characters, underscore and colon are allowed characters." + }, + "update_label_value": { + "update_label_value": "Update label value", + "label_name_placeholder": "label name", + "label_name_title": "Alphanumeric characters, underscore and colon are allowed characters.", + "to_value": "to value", + "new_value_placeholder": "new value", + "help_text": "On all matched notes, change value of the existing label.", + "help_text_note": "You can also call this method without value, in such case label will be assigned to the note without value." } }