add translation for bulk action and script execute

This commit is contained in:
Nriver
2024-07-29 10:23:32 +08:00
parent 92b0c7f0b7
commit bcf892ca37
4 changed files with 26 additions and 6 deletions

View File

@@ -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>