Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
add translation for bulk action and script execute
Nriverbcf892ca37cb
diff --git a/src/public/app/widgets/bulk_actions/abstract_bulk_action.js b/src/public/app/widgets/bulk_actions/abstract_bulk_action.jsindex 6bb01d2564..634f3d0733 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.jsindex 69d8e3cd9c..7adf399680 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 = `<tr><td>- Execute script:+ ${t('execute_script.execute_script')}</td><td><input type="text"@@ -16,13 +17,13 @@ const TPL = `<div class="dropdown help-dropdown"><span class="bx bx-help-circle icon-action" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"></span><div class="dropdown-menu dropdown-menu-right p-4">- You can execute simple scripts on the matched notes.+ ${t('execute_script.help_text')}- For example to append a string to a note's title, use this small script:+ ${t('execute_script.example_1')}<pre>note.title = note.title + ' - suffix';</pre>- More complex example would be deleting all matched note's attributes:+ ${t('execute_script.example_2')}<pre>for (const attr of note.getOwnedAttributes) { attr.markAsDeleted(); }</pre></div>diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.jsonindex 784278a239..fec3bb61f2 100644--- a/src/public/translations/cn/translation.json+++ b/src/public/translations/cn/translation.json@@ -395,11 +395,20 @@"help_text_body1": "要添加标签,只需输入例如 <code>#rock</code> 或者如果您还想添加值,则例如 <code>#year = 2020</code>","help_text_body2": "对于关系,请输入 <code>~author = @</code>,这将显示一个自动完成列表,您可以查找所需的笔记。","help_text_body3": "您也可以使用右侧的 <code>+</code> 按钮添加标签和关系。</p>",- "save_attributes": "报错属性 <enter>",+ "save_attributes": "保存属性 <enter>","add_a_new_attribute": "添加新属性","add_new_label": "添加新标签 <kbd data-command=\"addNewLabel\"></kbd>","add_new_relation": "添加新关系 <kbd data-command=\"addNewRelation\"></kbd>","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.jsonindex 4b8ea4ef6a..f7a68f5d1a 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 <kbd data-command=\"addNewRelation\"></kbd>","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:"}}