From 50434201cfd2a3f1364a5434feea8efee0b64808 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Tue, 30 Jul 2024 09:40:02 +0800 Subject: [PATCH] add translation for bulk action of notes --- .../widgets/bulk_actions/note/delete_note.js | 9 +++--- .../bulk_actions/note/delete_revisions.js | 9 +++--- .../widgets/bulk_actions/note/move_note.js | 17 ++++++----- .../widgets/bulk_actions/note/rename_note.js | 19 ++++++------ src/public/translations/cn/translation.json | 29 +++++++++++++++++++ src/public/translations/en/translation.json | 29 +++++++++++++++++++ 6 files changed, 86 insertions(+), 26 deletions(-) diff --git a/src/public/app/widgets/bulk_actions/note/delete_note.js b/src/public/app/widgets/bulk_actions/note/delete_note.js index 585a32749..544e57a07 100644 --- a/src/public/app/widgets/bulk_actions/note/delete_note.js +++ b/src/public/app/widgets/bulk_actions/note/delete_note.js @@ -1,3 +1,4 @@ +import { t } from "../../../services/i18n.js"; import AbstractBulkAction from "../abstract_bulk_action.js"; const TPL = ` @@ -5,17 +6,17 @@ const TPL = ` - Delete matched notes + ${t("delete_note.delete_matched_notes")} diff --git a/src/public/app/widgets/bulk_actions/note/delete_revisions.js b/src/public/app/widgets/bulk_actions/note/delete_revisions.js index 61b665ec1..2637ddcb3 100644 --- a/src/public/app/widgets/bulk_actions/note/delete_revisions.js +++ b/src/public/app/widgets/bulk_actions/note/delete_revisions.js @@ -1,27 +1,26 @@ +import { t } from "../../../services/i18n.js"; import AbstractBulkAction from "../abstract_bulk_action.js"; const TPL = ` - - Delete note revisions + ${t('delete_revisions.delete_note_revisions')} - `; export default class DeleteRevisionsBulkAction extends AbstractBulkAction { static get actionName() { return "deleteRevisions"; } - static get actionTitle() { return "Delete note revisions"; } + static get actionTitle() { return t('delete_revisions.delete_note_revisions'); } doRender() { return $(TPL); diff --git a/src/public/app/widgets/bulk_actions/note/move_note.js b/src/public/app/widgets/bulk_actions/note/move_note.js index ba11e9f70..43332d7cc 100644 --- a/src/public/app/widgets/bulk_actions/note/move_note.js +++ b/src/public/app/widgets/bulk_actions/note/move_note.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"; import noteAutocompleteService from "../../../services/note_autocomplete.js"; @@ -6,12 +7,12 @@ const TPL = `
-
Move note
+
${t('move_note.move_note')}
-
to
+
${t('move_note.to')}
- +
@@ -19,12 +20,12 @@ const TPL = ` @@ -35,7 +36,7 @@ const TPL = ` export default class MoveNoteBulkAction extends AbstractBulkAction { static get actionName() { return "moveNote"; } - static get actionTitle() { return "Move note"; } + static get actionTitle() { return t('move_note.move_note'); } doRender() { const $action = $(TPL); diff --git a/src/public/app/widgets/bulk_actions/note/rename_note.js b/src/public/app/widgets/bulk_actions/note/rename_note.js index 0d3a2ebf1..58832956e 100644 --- a/src/public/app/widgets/bulk_actions/note/rename_note.js +++ b/src/public/app/widgets/bulk_actions/note/rename_note.js @@ -1,31 +1,32 @@ import SpacedUpdate from "../../../services/spaced_update.js"; import AbstractBulkAction from "../abstract_bulk_action.js"; +import { t } from "../../../services/i18n.js"; const TPL = `
-
Rename note title to:
+
${t('rename_note.rename_note_title_to')}
+ placeholder="${t('rename_note.new_note_title')}" + title="${t('rename_note.click_help_icon')}"/>
@@ -35,7 +36,7 @@ const TPL = ` export default class RenameNoteBulkAction extends AbstractBulkAction { static get actionName() { return "renameNote"; } - static get actionTitle() { return "Rename note"; } + static get actionTitle() { return t('rename_note.rename_note'); } doRender() { const $action = $(TPL); diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index 8b79dd240..1e083d9e8 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -442,5 +442,34 @@ "new_value_placeholder": "新值", "help_text": "在所有匹配的笔记上,更改现有标签的值。", "help_text_note": "您也可以在不指定值的情况下调用此方法,这种情况下,标签将分配给没有值的笔记。" + }, + "delete_note": { + "delete_matched_notes": "删除匹配的笔记", + "delete_matched_notes_description": "这将删除匹配的笔记。", + "undelete_notes_instruction": "删除后,可以从“最近修改”对话框中恢复它们。", + "erase_notes_instruction": "要永久擦除笔记,您可以在删除后转到“选项”->“其他”,然后单击“立即擦除已删除的笔记”按钮。" + }, + "delete_revisions": { + "delete_note_revisions": "删除笔记修订", + "all_past_note_revisions": "所有匹配笔记的过去修订都将被删除。笔记本身将完全保留。换句话说,笔记的历史将被删除。" + }, + "move_note": { + "move_note": "移动笔记", + "to": "到", + "target_parent_note": "目标父笔记", + "on_all_matched_notes": "对于所有匹配的笔记", + "move_note_new_parent": "如果笔记只有一个父笔记,则将其移动到新父笔记(即旧位置被移除,并创建到新父笔记的位置)", + "clone_note_new_parent": "如果笔记有多个克隆/位置,则将其克隆到新父笔记(不清楚应删除哪个位置)", + "nothing_will_happen": "如果笔记无法移动到目标笔记(即这会创建一个树循环),则不会发生任何事情" + }, + "rename_note": { + "rename_note_title_to": "重命名笔记标题为:", + "new_note_title": "新笔记标题", + "click_help_icon": "点击右侧的帮助图标查看所有选项", + "evaluated_as_js_string": "给定的值被评估为JavaScript字符串,因此可以通过注入的note变量(正在重命名的笔记)丰富动态内容。 例如:", + "example_note": "Note - 所有匹配的笔记都被重命名为“Note”", + "example_new_title": "NEW: ${note.title} - 匹配的笔记标题以“NEW: ”为前缀", + "example_date_prefix": "${note.dateCreatedObj.format('MM-DD:')}: ${note.title} - 匹配的笔记以笔记的创建月份-日期为前缀", + "api_docs": "有关详细信息,请参阅笔记及其dateCreatedObj / utcDateCreatedObj 属性的API文档。" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index fab8c82e0..b72ca5f8f 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -442,5 +442,34 @@ "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." + }, + "delete_note": { + "delete_matched_notes": "Delete matched notes", + "delete_matched_notes_description": "This will delete matched notes.", + "undelete_notes_instruction": "After the deletion, it's possible to undelete them from Recent Changes dialog.", + "erase_notes_instruction": "To erase notes permanently, you can go after the deletion to the Option -> Other and click the \"Erase deleted notes now\" button." + }, + "delete_revisions": { + "delete_note_revisions": "Delete note revisions", + "all_past_note_revisions": "All past note revisions of matched notes will be deleted. Note itself will be fully preserved. In other terms, note's history will be removed." + }, + "move_note": { + "move_note": "Move note", + "to": "to", + "target_parent_note": "target parent note", + "on_all_matched_notes": "On all matched notes", + "move_note_new_parent": "move note to the new parent if note has only one parent (i.e. the old placement is removed and new placement into the new parent is created)", + "clone_note_new_parent": "clone note to the new parent if note has multiple clones/placements (it's not clear which placement should be removed)", + "nothing_will_happen": "nothing will happen if note cannot be moved to the target note (i.e. this would create a tree cycle)" + }, + "rename_note": { + "rename_note_title_to": "Rename note title to:", + "new_note_title": "new note title", + "click_help_icon": "Click help icon on the right to see all the options", + "evaluated_as_js_string": "The given value is evaluated as JavaScript string and thus can be enriched with dynamic content via the injected note variable (note being renamed). Examples:", + "example_note": "Note - all matched notes are renamed to 'Note'", + "example_new_title": "NEW: ${note.title} - matched notes titles are prefixed with 'NEW: '", + "example_date_prefix": "${note.dateCreatedObj.format('MM-DD:')}: ${note.title} - matched notes are prefixed with note's creation month-date", + "api_docs": "See API docs for note and its dateCreatedObj / utcDateCreatedObj properties for details." } }