`;
const DISPLAYED_NOTES = 10;
const ATTR_TITLES = {
- "label": "Label detail",
- "label-definition": "Label definition detail",
- "relation": "Relation detail",
- "relation-definition": "Relation definition detail"
+ "label": t('attribute_detail.label'),
+ "label-definition": t('attribute_detail.label_definition'),
+ "relation": t('attribute_detail.relation'),
+ "relation-definition": t('attribute_detail.relation_definition')
};
const ATTR_HELP = {
"label": {
- "disableVersioning": "disables auto-versioning. Useful for e.g. large, but unimportant notes - e.g. large JS libraries used for scripting",
- "calendarRoot": "marks note which should be used as root for day notes. Only one should be marked as such.",
- "archived": "notes with this label won't be visible by default in search results (also in Jump To, Add Link dialogs etc).",
- "excludeFromExport": "notes (with their sub-tree) won't be included in any note export",
- "run": `defines on which events script should run. Possible values are:
-
-
frontendStartup - when Trilium frontend starts up (or is refreshed), but not on mobile.
-
mobileStartup - when Trilium frontend starts up (or is refreshed), on mobile.
-
backendStartup - when Trilium backend starts up.
-
hourly - run once an hour. You can use additional label runAtHour to specify at which hour.
-
daily - run once a day
-
`,
- "runOnInstance": "Define which trilium instance should run this on. Default to all instances.",
- "runAtHour": "On which hour should this run. Should be used together with #run=hourly. Can be defined multiple times for more runs during the day.",
- "disableInclusion": "scripts with this label won't be included into parent script execution.",
- "sorted": "keeps child notes sorted by title alphabetically",
- "sortDirection": "ASC (the default) or DESC",
- "sortFoldersFirst": "Folders (notes with children) should be sorted on top",
- "top": "keep given note on top in its parent (applies only on sorted parents)",
- "hidePromotedAttributes": "Hide promoted attributes on this note",
- "readOnly": "editor is in read only mode. Works only for text and code notes.",
- "autoReadOnlyDisabled": "text/code notes can be set automatically into read mode when they are too large. You can disable this behavior on per-note basis by adding this label to the note",
- "appCss": "marks CSS notes which are loaded into the Trilium application and can thus be used to modify Trilium's looks.",
- "appTheme": "marks CSS notes which are full Trilium themes and are thus available in Trilium options.",
- "cssClass": "value of this label is then added as CSS class to the node representing given note in the tree. This can be useful for advanced theming. Can be used in template notes.",
- "iconClass": "value of this label is added as a CSS class to the icon on the tree which can help visually distinguish the notes in the tree. Example might be bx bx-home - icons are taken from boxicons. Can be used in template notes.",
- "pageSize": "number of items per page in note listing",
- "customRequestHandler": 'see Custom request handler',
- "customResourceProvider": 'see Custom request handler',
- "widget": "marks this note as a custom widget which will be added to the Trilium component tree",
- "workspace": "marks this note as a workspace which allows easy hoisting",
- "workspaceIconClass": "defines box icon CSS class which will be used in tab when hoisted to this note",
- "workspaceTabBackgroundColor": "CSS color used in the note tab when hoisted to this note",
- "workspaceCalendarRoot": "Defines per-workspace calendar root",
- "workspaceTemplate": "This note will appear in the selection of available template when creating new note, but only when hoisted into a workspace containing this template",
- "searchHome": "new search notes will be created as children of this note",
- "workspaceSearchHome": "new search notes will be created as children of this note when hoisted to some ancestor of this workspace note",
- "inbox": "default inbox location for new notes - when you create a note using \"new note\" button in the sidebar, notes will be created as child notes in the note marked as with #inbox label.",
- "workspaceInbox": "default inbox location for new notes when hoisted to some ancestor of this workspace note",
- "sqlConsoleHome": "default location of SQL console notes",
- "bookmarkFolder": "note with this label will appear in bookmarks as folder (allowing access to its children)",
- "shareHiddenFromTree": "this note is hidden from left navigation tree, but still accessible with its URL",
- "shareExternalLink": "note will act as a link to an external website in the share tree",
- "shareAlias": "define an alias using which the note will be available under https://your_trilium_host/share/[your_alias]",
- "shareOmitDefaultCss": "default share page CSS will be omitted. Use when you make extensive styling changes.",
- "shareRoot": "marks note which is served on /share root.",
- "shareDescription": "define text to be added to the HTML meta tag for description",
- "shareRaw": "note will be served in its raw format, without HTML wrapper",
- "shareDisallowRobotIndexing": `will forbid robot indexing of this note via X-Robots-Tag: noindex header`,
- "shareCredentials": "require credentials to access this shared note. Value is expected to be in format 'username:password'. Don't forget to make this inheritable to apply to child-notes/images.",
- "shareIndex": "note with this this label will list all roots of shared notes",
- "displayRelations": "comma delimited names of relations which should be displayed. All other ones will be hidden.",
- "hideRelations": "comma delimited names of relations which should be hidden. All other ones will be displayed.",
- "titleTemplate": `default title of notes created as children of this note. The value is evaluated as JavaScript string
- and thus can be enriched with dynamic content via the injected now and parentNote variables. Examples:
-
-
-
\${parentNote.getLabelValue('authorName')}'s literary works
-
Log for \${now.format('YYYY-MM-DD HH:mm:ss')}
-
-
- See wiki with details, API docs for parentNote and now for details.`,
- "template": "This note will appear in the selection of available template when creating new note",
- "toc": "#toc or #toc=show will force the Table of Contents to be shown, #toc=hide will force hiding it. If the label doesn't exist, the global setting is observed",
- "color": "defines color of the note in note tree, links etc. Use any valid CSS color value like 'red' or #a13d5f",
- "keyboardShortcut": "Defines a keyboard shortcut which will immediately jump to this note. Example: 'ctrl+alt+e'. Requires frontend reload for the change to take effect.",
- "keepCurrentHoisting": "Opening this link won't change hoisting even if the note is not displayable in the current hoisted subtree.",
- "executeButton": "Title of the button which will execute the current code note",
- "executeDescription": "Longer description of the current code note displayed together with the execute button",
- "excludeFromNoteMap": "Notes with this label will be hidden from the Note Map",
- "newNotesOnTop": "New notes will be created at the top of the parent note, not on the bottom.",
- "hideHighlightWidget": "Hide Hightlight List widget"
+ "disableVersioning": t('attribute_detail.disable_versioning'),
+ "calendarRoot": t('attribute_detail.calendar_root'),
+ "archived": t('attribute_detail.archived'),
+ "excludeFromExport": t('attribute_detail.exclude_from_export'),
+ "run": t('attribute_detail.run'),
+ "runOnInstance": t('attribute_detail.run_on_instance'),
+ "runAtHour": t('attribute_detail.run_at_hour'),
+ "disableInclusion": t('attribute_detail.disable_inclusion'),
+ "sorted": t('attribute_detail.sorted'),
+ "sortDirection": t('attribute_detail.sort_direction'),
+ "sortFoldersFirst": t('attribute_detail.sort_folders_first'),
+ "top": t('attribute_detail.top'),
+ "hidePromotedAttributes": t('attribute_detail.hide_promoted_attributes'),
+ "readOnly": t('attribute_detail.read_only'),
+ "autoReadOnlyDisabled": t('attribute_detail.auto_read_only_disabled'),
+ "appCss": t('attribute_detail.app_css'),
+ "appTheme": t('attribute_detail.app_theme'),
+ "cssClass": t('attribute_detail.css_class'),
+ "iconClass": t('attribute_detail.icon_class'),
+ "pageSize": t('attribute_detail.page_size'),
+ "customRequestHandler": t('attribute_detail.custom_request_handler'),
+ "customResourceProvider": t('attribute_detail.custom_resource_provider'),
+ "widget": t('attribute_detail.widget'),
+ "workspace": t('attribute_detail.workspace'),
+ "workspaceIconClass": t('attribute_detail.workspace_icon_class'),
+ "workspaceTabBackgroundColor": t('attribute_detail.workspace_tab_background_color'),
+ "workspaceCalendarRoot": t('attribute_detail.workspace_calendar_root'),
+ "workspaceTemplate": t('attribute_detail.workspace_template'),
+ "searchHome": t('attribute_detail.search_home'),
+ "workspaceSearchHome": t('attribute_detail.workspace_search_home'),
+ "inbox": t('attribute_detail.inbox'),
+ "workspaceInbox": t('attribute_detail.workspace_inbox'),
+ "sqlConsoleHome": t('attribute_detail.sql_console_home'),
+ "bookmarkFolder": t('attribute_detail.bookmark_folder'),
+ "shareHiddenFromTree": t('attribute_detail.share_hidden_from_tree'),
+ "shareExternalLink": t('attribute_detail.share_external_link'),
+ "shareAlias": t('attribute_detail.share_alias'),
+ "shareOmitDefaultCss": t('attribute_detail.share_omit_default_css'),
+ "shareRoot": t('attribute_detail.share_root'),
+ "shareDescription": t('attribute_detail.share_description'),
+ "shareRaw": t('attribute_detail.share_raw'),
+ "shareDisallowRobotIndexing": t('attribute_detail.share_disallow_robot_indexing'),
+ "shareCredentials": t('attribute_detail.share_credentials'),
+ "shareIndex": t('attribute_detail.share_index'),
+ "displayRelations": t('attribute_detail.display_relations'),
+ "hideRelations": t('attribute_detail.hide_relations'),
+ "titleTemplate": t('attribute_detail.title_template'),
+ "template": t('attribute_detail.template'),
+ "toc": t('attribute_detail.toc'),
+ "color": t('attribute_detail.color'),
+ "keyboardShortcut": t('attribute_detail.keyboard_shortcut'),
+ "keepCurrentHoisting": t('attribute_detail.keep_current_hoisting'),
+ "executeButton": t('attribute_detail.execute_button'),
+ "executeDescription": t('attribute_detail.execute_description'),
+ "excludeFromNoteMap": t('attribute_detail.exclude_from_note_map'),
+ "newNotesOnTop": t('attribute_detail.new_notes_on_top'),
+ "hideHighlightWidget": t('attribute_detail.hide_highlight_widget')
},
"relation": {
- "runOnNoteCreation": "executes when note is created on backend. Use this relation if you want to run the script for all notes created under a specific subtree. In that case, create it on the subtree root note and make it inheritable. A new note created within the subtree (any depth) will trigger the script.",
- "runOnChildNoteCreation": "executes when new note is created under the note where this relation is defined",
- "runOnNoteTitleChange": "executes when note title is changed (includes note creation as well)",
- "runOnNoteContentChange": "executes when note content is changed (includes note creation as well).",
- "runOnNoteChange": "executes when note is changed (includes note creation as well). Does not include content changes",
- "runOnNoteDeletion": "executes when note is being deleted",
- "runOnBranchCreation": "executes when a branch is created. Branch is a link between parent note and child note and is created e.g. when cloning or moving note.",
- "runOnBranchChange": "executes when a branch is updated.",
- "runOnBranchDeletion": "executes when a branch is deleted. Branch is a link between parent note and child note and is deleted e.g. when moving note (old branch/link is deleted).",
- "runOnAttributeCreation": "executes when new attribute is created for the note which defines this relation",
- "runOnAttributeChange": " executes when the attribute is changed of a note which defines this relation. This is triggered also when the attribute is deleted",
- "template": "note's attributes will be inherited even without a parent-child relationship, note's content and subtree will be added to instance notes if empty. See documentation for details.",
- "inherit": "note's attributes will be inherited even without a parent-child relationship. See template relation for a similar concept. See attribute inheritance in the documentation.",
- "renderNote": 'notes of type "render HTML note" will be rendered using a code note (HTML or script) and it is necessary to point using this relation to which note should be rendered',
- "widget": "target of this relation will be executed and rendered as a widget in the sidebar",
- "shareCss": "CSS note which will be injected into the share page. CSS note must be in the shared sub-tree as well. Consider using 'shareHiddenFromTree' and 'shareOmitDefaultCss' as well.",
- "shareJs": "JavaScript note which will be injected into the share page. JS note must be in the shared sub-tree as well. Consider using 'shareHiddenFromTree'.",
- "shareTemplate": "Embedded JavaScript note that will be used as the template for displaying the shared note. Falls back to the default template. Consider using 'shareHiddenFromTree'.",
- "shareFavicon": "Favicon note to be set in the shared page. Typically you want to set it to share root and make it inheritable. Favicon note must be in the shared sub-tree as well. Consider using 'shareHiddenFromTree'.",
+ "runOnNoteCreation": t('attribute_detail.run_on_note_creation'),
+ "runOnChildNoteCreation": t('attribute_detail.run_on_child_note_creation'),
+ "runOnNoteTitleChange": t('attribute_detail.run_on_note_title_change'),
+ "runOnNoteContentChange": t('attribute_detail.run_on_note_content_change'),
+ "runOnNoteChange": t('attribute_detail.run_on_note_change'),
+ "runOnNoteDeletion": t('attribute_detail.run_on_note_deletion'),
+ "runOnBranchCreation": t('attribute_detail.run_on_branch_creation'),
+ "runOnBranchChange": t('attribute_detail.run_on_branch_change'),
+ "runOnBranchDeletion": t('attribute_detail.run_on_branch_deletion'),
+ "runOnAttributeCreation": t('attribute_detail.run_on_attribute_creation'),
+ "runOnAttributeChange": t('attribute_detail.run_on_attribute_change'),
+ "template": t('attribute_detail.relation_template'),
+ "inherit": t('attribute_detail.inherit'),
+ "renderNote": t('attribute_detail.render_note'),
+ "widget": t('attribute_detail.widget_relation'),
+ "shareCss": t('attribute_detail.share_css'),
+ "shareJs": t('attribute_detail.share_js'),
+ "shareTemplate": t('attribute_detail.share_template'),
+ "shareFavicon": t('attribute_detail.share_favicon')
}
};
@@ -454,7 +440,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget {
.show()
.empty()
.append(attribute.type === 'label' ? 'Label' : 'Relation')
- .append(' is owned by note ')
+ .append(` ${t("attribute_detail.is_owned_by_note")} `)
.append(await linkService.createLink(attribute.noteId))
}
@@ -615,7 +601,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget {
this.$relatedNotesContainer.hide();
} else {
this.$relatedNotesContainer.show();
- this.$relatedNotesTitle.text(`Other notes with ${this.attribute.type} name "${this.attribute.name}"`);
+ this.$relatedNotesTitle.text(t("attribute_detail.other_notes_with_name", {attributeType: this.attribute.type, attributeName: this.attribute.name}));
this.$relatedNotesList.empty();
@@ -633,7 +619,7 @@ export default class AttributeDetailWidget extends NoteContextAwareWidget {
}
if (results.length > DISPLAYED_NOTES) {
- this.$relatedNotesMoreNotes.show().text(`... and ${count - DISPLAYED_NOTES} more.`);
+ this.$relatedNotesMoreNotes.show().text(t("attribute_detail.and_more", {count: count - DISPLAYED_NOTES}));
} else {
this.$relatedNotesMoreNotes.hide();
}
diff --git a/src/public/app/widgets/attribute_widgets/attribute_editor.js b/src/public/app/widgets/attribute_widgets/attribute_editor.js
index 303a577b5..aa86ec5cc 100644
--- a/src/public/app/widgets/attribute_widgets/attribute_editor.js
+++ b/src/public/app/widgets/attribute_widgets/attribute_editor.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import NoteContextAwareWidget from "../note_context_aware_widget.js";
import noteAutocompleteService from "../../services/note_autocomplete.js";
import server from "../../services/server.js";
@@ -11,11 +12,11 @@ import attributeService from "../../services/attributes.js";
import linkService from "../../services/link.js";
const HELP_TEXT = `
-
To add label, just type e.g. #rock or if you want to add also value then e.g. #year = 2020
+
${t("attribute_editor.help_text_body1")}
-
For relation, type ~author = @ which should bring up an autocomplete where you can look up the desired note.
+
${t("attribute_editor.help_text_body2")}
-
Alternatively you can add label and relation using the + button on the right side.
- 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')}
note.title = note.title + ' - suffix';
- More complex example would be deleting all matched note's attributes:
+ ${t('execute_script.example_2')}
for (const attr of note.getOwnedAttributes) { attr.markAsDeleted(); }
@@ -35,7 +36,7 @@ const TPL = `
export default class ExecuteScriptBulkAction extends AbstractBulkAction {
static get actionName() { return "executeScript"; }
- static get actionTitle() { return "Execute script"; }
+ static get actionTitle() { return t("execute_script.execute_script"); }
doRender() {
const $action = $(TPL);
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..ba678dc7c 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")}
-
+
-
On all matched notes:
+
${t("add_label.help_text")}
-
create given label if note doesn't have one yet
-
or change value of the existing label
+
${t("add_label.help_text_item1")}
+
${t("add_label.help_text_item2")}
-
You can also call this method without value, in such case label will be assigned to the note without value.
+
${t("add_label.help_text_note")}
@@ -39,7 +40,7 @@ const TPL = `
export default class AddLabelBulkAction extends AbstractBulkAction {
static get actionName() { return "addLabel"; }
- static get actionTitle() { return "Add label"; }
+ static get actionTitle() { return t("add_label.add_label"); }
doRender() {
const $action = $(TPL);
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..ba2c393a0 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 = `
- 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.
+ ${t('delete_revisions.all_past_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 = `
-
On all matched notes:
+
${t('move_note.on_all_matched_notes')}:
-
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 to the new parent if note has multiple clones/placements (it's not clear which placement should be removed)
-
nothing will happen if note cannot be moved to the target note (i.e. this would create a tree cycle)
+
${t('move_note.move_note_new_parent')}
+
${t('move_note.clone_note_new_parent')}
+
${t('move_note.nothing_will_happen')}
@@ -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 = `
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:
+
${t('rename_note.evaluated_as_js_string')}
-
Note - all matched notes are renamed to "Note"
-
NEW: \${note.title} - matched notes titles are prefixed with "NEW: "
-
\${note.dateCreatedObj.format('MM-DD:')}: \${note.title} - matched notes are prefixed with note's creation month-date
@@ -70,26 +71,24 @@ export default class AttachmentActionsWidget extends BasicWidget {
const result = await server.upload(`attachments/${this.attachmentId}/file`, fileToUpload);
if (result.uploaded) {
- toastService.showMessage("New attachment revision has been uploaded.");
+ toastService.showMessage(t('attachments_actions.upload_success'));
} else {
- toastService.showError("Upload of a new attachment revision failed.");
+ toastService.showError(t('attachments_actions.upload_failed'));
}
});
if (!this.isFullDetail) {
- // we deactivate this button because the WatchedFileUpdateStatusWidget assumes only one visible attachment
- // in a note context, so it doesn't work in a list
const $openAttachmentButton = this.$widget.find("[data-trigger-command='openAttachment']");
$openAttachmentButton
.addClass("disabled")
.append($(' (?)')
- .attr("title", "Opening attachment externally is available only from the detail page, please first click on the attachment detail first and repeat the action.")
+ .attr("title", t('attachments_actions.open_externally_detail_page'))
);
const $openAttachmentCustomButton = this.$widget.find("[data-trigger-command='openAttachmentCustom']");
$openAttachmentCustomButton
.addClass("disabled")
.append($(' (?)')
- .attr("title", "Opening attachment externally is available only from the detail page, please first click on the attachment detail first and repeat the action.")
+ .attr("title", t('attachments_actions.open_externally_detail_page'))
);
}
if (!utils.isElectron()){
@@ -97,7 +96,7 @@ export default class AttachmentActionsWidget extends BasicWidget {
$openAttachmentCustomButton
.addClass("disabled")
.append($(' (?)')
- .attr("title", "Custom opening of attachments can only be done from the client.")
+ .attr("title", t('attachments_actions.open_custom_client_only'))
);
}
}
@@ -123,29 +122,29 @@ export default class AttachmentActionsWidget extends BasicWidget {
}
async deleteAttachmentCommand() {
- if (!await dialogService.confirm(`Are you sure you want to delete attachment '${this.attachment.title}'?`)) {
+ if (!await dialogService.confirm(t('attachments_actions.delete_confirm', { title: this.attachment.title }))) {
return;
}
await server.remove(`attachments/${this.attachmentId}`);
- toastService.showMessage(`Attachment '${this.attachment.title}' has been deleted.`);
+ toastService.showMessage(t('attachments_actions.delete_success', { title: this.attachment.title }));
}
async convertAttachmentIntoNoteCommand() {
- if (!await dialogService.confirm(`Are you sure you want to convert attachment '${this.attachment.title}' into a separate note?`)) {
+ if (!await dialogService.confirm(t('attachments_actions.convert_confirm', { title: this.attachment.title }))) {
return;
}
const {note: newNote} = await server.post(`attachments/${this.attachmentId}/convert-to-note`)
- toastService.showMessage(`Attachment '${this.attachment.title}' has been converted to note.`);
+ toastService.showMessage(t('attachments_actions.convert_success', { title: this.attachment.title }));
await ws.waitForMaxKnownEntityChangeId();
await appContext.tabManager.getActiveContext().setNote(newNote.noteId);
}
async renameAttachmentCommand() {
const attachmentTitle = await dialogService.prompt({
- title: "Rename attachment",
- message: "Please enter new attachment's name",
+ title: t('attachments_actions.rename_attachment'),
+ message: t('attachments_actions.enter_new_name'),
defaultValue: this.attachment.title
});
diff --git a/src/public/app/widgets/buttons/calendar.js b/src/public/app/widgets/buttons/calendar.js
index f05aedd9a..3980ca8b3 100644
--- a/src/public/app/widgets/buttons/calendar.js
+++ b/src/public/app/widgets/buttons/calendar.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import libraryLoader from "../../services/library_loader.js";
import utils from "../../services/utils.js";
import dateNoteService from "../../services/date_notes.js";
@@ -23,7 +24,7 @@ const DROPDOWN_TPL = `
not set in tree pane will switch from tree pane into note title. Enter from note title will switch focus to text editor.
- not set will switch back from editor to tree pane.
-
Ctrl+K - create / edit external link
-
not set - create internal link
-
not set - follow link under cursor
-
not set - insert current date and time at caret position
-
not set - jump away to the tree pane and scroll to active note
start a line with > followed by space for block quote
+
##, ###, #### ${t('help.headings')}
+
${t('help.bulletList')}
+
${t('help.numberedList')}
+
${t('help.blockQuote')}
@@ -122,13 +122,13 @@ const TPL = `
-
Troubleshooting
+
${t('help.troubleshooting')}
-
not set - reload Trilium frontend
-
not set - show developer tools
-
not set - show SQL console
+
${t('help.notSet')} - ${t('help.reloadFrontend')}
+
${t('help.notSet')} - ${t('help.showDevTools')}
+
${t('help.notSet')} - ${t('help.showSQLConsole')}
@@ -136,12 +136,12 @@ const TPL = `
-
Other
+
${t('help.other')}
-
not set - focus on quick search input
-
not set - in page search
+
${t('help.notSet')} - ${t('help.quickSearch')}
+
${t('help.notSet')} - ${t('help.inPageSearch')}
diff --git a/src/public/app/widgets/dialogs/import.js b/src/public/app/widgets/dialogs/import.js
index 4121b78fb..b50bbf291 100644
--- a/src/public/app/widgets/dialogs/import.js
+++ b/src/public/app/widgets/dialogs/import.js
@@ -3,75 +3,74 @@ import treeService from "../../services/tree.js";
import importService from "../../services/import.js";
import options from "../../services/options.js";
import BasicWidget from "../basic_widget.js";
+import { t } from "../../services/i18n.js";
const TPL = `
-
Import into note
-
+
${t('import.importIntoNote')}
+ ×
diff --git a/src/public/app/widgets/dialogs/include_note.js b/src/public/app/widgets/dialogs/include_note.js
index f4d81778d..64f07da66 100644
--- a/src/public/app/widgets/dialogs/include_note.js
+++ b/src/public/app/widgets/dialogs/include_note.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import treeService from '../../services/tree.js';
import noteAutocompleteService from '../../services/note_autocomplete.js';
import utils from "../../services/utils.js";
@@ -9,7 +10,7 @@ const TPL = `
-
Include note
+
${t('include_note.dialog_title')}
×
@@ -17,35 +18,35 @@ const TPL = `
@@ -62,10 +63,8 @@ export default class IncludeNoteDialog extends BasicWidget {
if (notePath) {
this.$widget.modal('hide');
-
this.includeNote(notePath);
- }
- else {
+ } else {
logError("No noteId to include.");
}
@@ -75,15 +74,12 @@ export default class IncludeNoteDialog extends BasicWidget {
async showIncludeNoteDialogEvent({textTypeWidget}) {
this.textTypeWidget = textTypeWidget;
-
await this.refresh();
-
utils.openDialog(this.$widget);
}
async refresh(widget) {
this.$autoComplete.val('');
-
noteAutocompleteService.initNoteAutocomplete(this.$autoComplete, {
hideGoToSelectedNoteButton: true,
allowCreatingNotes: true
@@ -94,15 +90,13 @@ export default class IncludeNoteDialog extends BasicWidget {
async includeNote(notePath) {
const noteId = treeService.getNoteIdFromUrl(notePath);
const note = await froca.getNote(noteId);
-
const boxSize = $("input[name='include-note-box-size']:checked").val();
if (['image', 'canvas', 'mermaid'].includes(note.type)) {
// there's no benefit to use insert note functionlity for images,
// so we'll just add an IMG tag
this.textTypeWidget.addImage(noteId);
- }
- else {
+ } else {
this.textTypeWidget.addIncludeNote(noteId, boxSize);
}
}
diff --git a/src/public/app/widgets/dialogs/info.js b/src/public/app/widgets/dialogs/info.js
index 738ac438d..5bfdb31cd 100644
--- a/src/public/app/widgets/dialogs/info.js
+++ b/src/public/app/widgets/dialogs/info.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import utils from "../../services/utils.js";
import BasicWidget from "../basic_widget.js";
@@ -6,9 +7,9 @@ const TPL = `
-
Info message
+
${t("info.modalTitle")}
-
+ ×
@@ -16,7 +17,7 @@ const TPL = `
diff --git a/src/public/app/widgets/dialogs/jump_to_note.js b/src/public/app/widgets/dialogs/jump_to_note.js
index c6bfed2e7..c8f33a11a 100644
--- a/src/public/app/widgets/dialogs/jump_to_note.js
+++ b/src/public/app/widgets/dialogs/jump_to_note.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import noteAutocompleteService from '../../services/note_autocomplete.js';
import utils from "../../services/utils.js";
import appContext from "../../components/app_context.js";
@@ -9,7 +10,7 @@ const TPL = `
-
+
@@ -20,7 +21,7 @@ const TPL = `
diff --git a/src/public/app/widgets/dialogs/markdown_import.js b/src/public/app/widgets/dialogs/markdown_import.js
index b57d41574..48bbf851d 100644
--- a/src/public/app/widgets/dialogs/markdown_import.js
+++ b/src/public/app/widgets/dialogs/markdown_import.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import toastService from "../../services/toast.js";
import utils from "../../services/utils.js";
import appContext from "../../components/app_context.js";
@@ -10,18 +11,18 @@ const TPL = `
-
Markdown import
+
${t("markdown_import.dialog_title")}
×
-
Because of browser sandbox it's not possible to directly read clipboard from JavaScript. Please paste the Markdown to import to textarea below and click on Import button
+
${t("markdown_import.modal_body_text")}
@@ -56,7 +57,7 @@ export default class MarkdownImportDialog extends BasicWidget {
textEditor.model.insertContent(modelFragment, textEditor.model.document.selection);
- toastService.showMessage("Markdown content has been imported into the document.");
+ toastService.showMessage(t("markdown_import.import_success"));
}
async pasteMarkdownIntoTextEvent() {
diff --git a/src/public/app/widgets/dialogs/move_to.js b/src/public/app/widgets/dialogs/move_to.js
index 73e678834..38063dd17 100644
--- a/src/public/app/widgets/dialogs/move_to.js
+++ b/src/public/app/widgets/dialogs/move_to.js
@@ -5,13 +5,14 @@ import froca from "../../services/froca.js";
import branchService from "../../services/branches.js";
import treeService from "../../services/tree.js";
import BasicWidget from "../basic_widget.js";
+import { t } from "../../services/i18n.js"; // Added import
const TPL = `
-
Move notes to ...
+
${t("move_to.dialog_title")}
×
@@ -19,21 +20,21 @@ const TPL = `
@@ -63,7 +64,7 @@ export default class MoveToDialog extends BasicWidget {
froca.getBranchId(parentNoteId, noteId).then(branchId => this.moveNotesTo(branchId));
}
else {
- logError("No path to move to.");
+ logError(t("move_to.error_no_path"));
}
return false;
@@ -96,6 +97,6 @@ export default class MoveToDialog extends BasicWidget {
const parentBranch = froca.getBranch(parentBranchId);
const parentNote = await parentBranch.getNote();
- toastService.showMessage(`Selected notes have been moved into ${parentNote.title}`);
+ toastService.showMessage(`${t("move_to.move_success_message")} ${parentNote.title}`);
}
}
diff --git a/src/public/app/widgets/dialogs/note_type_chooser.js b/src/public/app/widgets/dialogs/note_type_chooser.js
index 9a55b9417..18687bb46 100644
--- a/src/public/app/widgets/dialogs/note_type_chooser.js
+++ b/src/public/app/widgets/dialogs/note_type_chooser.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import noteTypesService from "../../services/note_types.js";
import BasicWidget from "../basic_widget.js";
@@ -22,17 +23,17 @@ const TPL = `
-
Choose note type
+
${t("note_type_chooser.modal_title")}
×
- Choose note type / template of the new note:
+ ${t("note_type_chooser.modal_body")}
').append(t("note_type_chooser.templates")));
}
else {
this.$noteTypeDropdown.append(
diff --git a/src/public/app/widgets/dialogs/password_not_set.js b/src/public/app/widgets/dialogs/password_not_set.js
index 011cc51d4..60fd4fbca 100644
--- a/src/public/app/widgets/dialogs/password_not_set.js
+++ b/src/public/app/widgets/dialogs/password_not_set.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import utils from "../../services/utils.js";
import BasicWidget from "../basic_widget.js";
@@ -6,17 +7,16 @@ const TPL = `
-
Password is not set
+
${t("password_not_set.title")}
×
- Protected notes are encrypted using a user password, but password has not been set yet.
-
- To be able to protect notes,
- click here to open the Options dialog and set your password.
+ ${t("password_not_set.body1")}
+
+ ${t("password_not_set.body2")}
diff --git a/src/public/app/widgets/dialogs/prompt.js b/src/public/app/widgets/dialogs/prompt.js
index 30aa326c5..2960632ca 100644
--- a/src/public/app/widgets/dialogs/prompt.js
+++ b/src/public/app/widgets/dialogs/prompt.js
@@ -1,3 +1,4 @@
+import { t } from "../../services/i18n.js";
import utils from "../../services/utils.js";
import BasicWidget from "../basic_widget.js";
@@ -7,8 +8,7 @@ const TPL = `