i18n: make duplicate notes suffix translatable

This commit is contained in:
Panagiotis Papadopoulos 2024-12-28 22:41:40 +01:00
parent 62696a4e0a
commit 256853a6f8
2 changed files with 7 additions and 3 deletions

View File

@ -923,8 +923,10 @@ function duplicateSubtree(origNoteId: string, newParentNoteId: string) {
const res = duplicateSubtreeInner(origNote, origBranch, newParentNoteId, noteIdMapping); const res = duplicateSubtreeInner(origNote, origBranch, newParentNoteId, noteIdMapping);
if (!res.note.title.endsWith('(dup)')) { const duplicateNoteSuffix = t("notes.duplicate-note-suffix");
res.note.title += " (dup)";
if (!res.note.title.endsWith(duplicateNoteSuffix) && !res.note.title.startsWith(duplicateNoteSuffix)) {
res.note.title = t("notes.duplicate-note-title", { noteTitle: res.note.title, duplicateNoteSuffix: duplicateNoteSuffix });
} }
res.note.save(); res.note.save();

View File

@ -242,6 +242,8 @@
"visible-launchers-title": "Visible Launchers" "visible-launchers-title": "Visible Launchers"
}, },
"notes": { "notes": {
"new-note": "New note" "new-note": "New note",
"duplicate-note-suffix": "(dup)",
"duplicate-note-title": "{{ noteTitle }} {{ duplicateNoteSuffix }}"
} }
} }