Skip to content

Build your personal knowledge base with Trilium Notes

i18n: Translate confirmation popups

Elian Doran8cc487da7c8c
diff --git a/src/public/app/menus/launcher_context_menu.js b/src/public/app/menus/launcher_context_menu.js
index 5f6607f89e..1db6bb1f67 100644
--- a/src/public/app/menus/launcher_context_menu.js
+++ b/src/public/app/menus/launcher_context_menu.js
@@ -3,6 +3,7 @@ import froca from "../services/froca.js";
import contextMenu from "./context_menu.js";
import dialogService from "../services/dialog.js";
import server from "../services/server.js";
+import { t } from '../services/i18n.js';
export default class LauncherContextMenu {
/**
@@ -53,9 +54,7 @@ export default class LauncherContextMenu {
async selectMenuItemHandler({command}) {
if (command === 'resetLauncher') {
- const confirmed = await dialogService.confirm(`Do you really want to reset "${this.node.title}"?
- All data / settings in this note (and its children) will be lost
- and the launcher will be returned to its original location.`);
+ const confirmed = await dialogService.confirm(t("launcher_context_menu.reset_launcher_confirm", { title: this.node.title }));
if (confirmed) {
await server.post(`special-notes/launchers/${this.node.data.noteId}/reset`);
diff --git a/src/public/app/menus/tree_context_menu.js b/src/public/app/menus/tree_context_menu.js
index fbac3321c1..7609c99f5f 100644
--- a/src/public/app/menus/tree_context_menu.js
+++ b/src/public/app/menus/tree_context_menu.js
@@ -136,7 +136,7 @@ export default class TreeContextMenu {
this.treeWidget.triggerCommand("openNewNoteSplit", {ntxId, notePath});
}
else if (command === 'convertNoteToAttachment') {
- if (!await dialogService.confirm(`Are you sure you want to convert note selected notes into attachments of their parent notes?`)) {
+ if (!await dialogService.confirm(t("tree-context-menu.convert-to-attachment-confirm"))) {
return;
}
diff --git a/src/public/app/services/hoisted_note.js b/src/public/app/services/hoisted_note.js
index d6a3916de7..23d705db87 100644
--- a/src/public/app/services/hoisted_note.js
+++ b/src/public/app/services/hoisted_note.js
@@ -2,6 +2,7 @@ import appContext from "../components/app_context.js";
import treeService from "./tree.js";
import dialogService from "./dialog.js";
import froca from "./froca.js";
+import { t } from "./i18n.js";
function getHoistedNoteId() {
const activeNoteContext = appContext.tabManager.getActiveContext();
@@ -53,7 +54,7 @@ async function checkNoteAccess(notePath, noteContext) {
const hoistedNote = await froca.getNote(hoistedNoteId);
if ((!hoistedNote.hasAncestor('_hidden') || resolvedNotePath.includes('_lbBookmarks'))
- && !await dialogService.confirm(`Requested note '${requestedNote.title}' is outside of hoisted note '${hoistedNote.title}' subtree and you must unhoist to access the note. Do you want to proceed with unhoisting?`)) {
+ && !await dialogService.confirm(t("hoisted_note.confirm_unhoisting", { requestedNote: requestedNote.title, hoistedNote: hoistedNote.title }))) {
return false;
}
diff --git a/src/public/app/widgets/buttons/note_actions.js b/src/public/app/widgets/buttons/note_actions.js
index dbe3243226..bf24a67050 100644
--- a/src/public/app/widgets/buttons/note_actions.js
+++ b/src/public/app/widgets/buttons/note_actions.js
@@ -127,7 +127,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
}
async convertNoteIntoAttachmentCommand() {
- if (!await dialogService.confirm(`Are you sure you want to convert note '${this.note.title}' into an attachment of the parent note?`)) {
+ if (!await dialogService.confirm(t("note_actions.convert_into_attachment_prompt", { title: this.note.title }))) {
return;
}
diff --git a/src/public/app/widgets/note_type.js b/src/public/app/widgets/note_type.js
index 7e15c4f089..7c5003d5b6 100644
--- a/src/public/app/widgets/note_type.js
+++ b/src/public/app/widgets/note_type.js
@@ -159,7 +159,7 @@ export default class NoteTypeWidget extends NoteContextAwareWidget {
return true;
}
- return await dialogService.confirm("It is not recommended to change note type when note content is not empty. Do you want to continue anyway?");
+ return await dialogService.confirm(t("note_types.confirm-change"));
}
async entitiesReloadedEvent({ loadResults }) {
diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json
index b5d4de3861..608f1a0e76 100644
--- a/src/public/translations/en/translation.json
+++ b/src/public/translations/en/translation.json
@@ -635,7 +635,8 @@
"print_note": "Print note",
"save_revision": "Save revision",
"convert_into_attachment_failed": "Converting note '{{title}}' failed.",
- "convert_into_attachment_successful": "Note '{{title}' has been converted to attachment."
+ "convert_into_attachment_successful": "Note '{{title}' has been converted to attachment.",
+ "convert_into_attachment_prompt": "Are you sure you want to convert note '{{title}}' into an attachment of the parent note?"
},
"onclick_button": {
"no_click_handler": "Button widget '{{componentId}}' has no defined click handler"
@@ -1325,7 +1326,8 @@
"export": "Export",
"import-into-note": "Import into note",
"apply-bulk-actions": "Apply bulk actions",
- "converted-to-attachments": "{{count}} notes have been converted to attachments."
+ "converted-to-attachments": "{{count}} notes have been converted to attachments.",
+ "convert-to-attachment-confirm": "Are you sure you want to convert note selected notes into attachments of their parent notes?"
},
"shared_info": {
"shared_publicly": "This note is shared publicly on",
@@ -1348,7 +1350,8 @@
"image": "Image",
"launcher": "Launcher",
"doc": "Doc",
- "widget": "Widget"
+ "widget": "Widget",
+ "confirm-change": "It is not recommended to change note type when note content is not empty. Do you want to continue anyway?"
},
"protect_note": {
"toggle-on": "Protect the note",
@@ -1468,5 +1471,11 @@
"sync-check-failed": "Sync check failed!",
"consistency-checks-failed": "Consistency checks failed! See logs for details.",
"encountered-error": "Encountered error \"{{message}}\", check out the console."
+ },
+ "hoisted_note": {
+ "confirm_unhoisting": "Requested note '{{requestedNote}}' is outside of hoisted note '{{hoistedNote}}' subtree and you must unhoist to access the note. Do you want to proceed with unhoisting?"
+ },
+ "launcher_context_menu": {
+ "reset_launcher_confirm": "Do you really want to reset \"{{title}}\"? All data / settings in this note (and its children) will be lost and the launcher will be returned to its original location."
}
}
diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.json
index 902215f08c..fb6521a320 100644
--- a/src/public/translations/ro/translation.json
+++ b/src/public/translations/ro/translation.json
@@ -788,7 +788,8 @@
"save_revision": "Salvează o nouă revizie",
"search_in_note": "Caută în notiță",
"convert_into_attachment_failed": "Nu s-a putut converti notița „{{title}}”.",
- "convert_into_attachment_successful": "Notița „{{title}}” a fost convertită în atașament."
+ "convert_into_attachment_successful": "Notița „{{title}}” a fost convertită în atașament.",
+ "convert_into_attachment_prompt": "Doriți convertirea notiței „{{title}}” într-un atașament al notiței părinte?"
},
"note_erasure_timeout": {
"deleted_notes_erased": "Notițele șterse au fost eliminate permanent.",
@@ -1295,7 +1296,8 @@
"unprotect-subtree": "Deprotejează ierarhia",
"hoist-note": "Focalizează notița",
"unhoist-note": "Defocalizează notița",
- "converted-to-attachments": "{{count}} notițe au fost convertite în atașamente."
+ "converted-to-attachments": "{{count}} notițe au fost convertite în atașamente.",
+ "convert-to-attachment-confirm": "Doriți convertirea notițelor selectate în atașamente ale notiței părinte?"
},
"shared_info": {
"help_link": "Pentru informații vizitați <a href=\"https://triliumnext.github.io/Docs/Wiki/sharing.html\">wiki-ul</a>.",
@@ -1318,7 +1320,8 @@
"file": "Fișier",
"image": "Imagine",
"launcher": "Scurtătură",
- "widget": "Widget"
+ "widget": "Widget",
+ "confirm-change": "Nu se recomandă schimbarea tipului notiței atunci când ea are un conținut. Procedați oricum?"
},
"protect_note": {
"toggle-off": "Deprotejează notița",
@@ -1468,5 +1471,11 @@
"consistency-checks-failed": "Au fost identificate erori de consistență! Vedeți mai multe detalii în loguri.",
"encountered-error": "A fost întâmpinată o eroare: „{{message}}”. Vedeți în loguri pentru mai multe detalii.",
"sync-check-failed": "Verificările de sincronizare au eșuat!"
+ },
+ "hoisted_note": {
+ "confirm_unhoisting": "Notița dorită „{{requestedNote}}” este în afara ierarhiei notiței focalizate „{{hoistedNote}}”. Doriți defocalizarea pentru a accesa notița?"
+ },
+ "launcher_context_menu": {
+ "reset_launcher_confirm": "Doriți resetarea lansatorului „{{title}}”? Toate datele și setările din această notiță (și subnotițele ei) vor fi pierdute, iar lansatorul va fi resetat în poziția lui originală."
}
}