diff --git a/src/services/notes.ts b/src/services/notes.ts index 14a44020f..73ec387fa 100644 --- a/src/services/notes.ts +++ b/src/services/notes.ts @@ -923,8 +923,10 @@ function duplicateSubtree(origNoteId: string, newParentNoteId: string) { const res = duplicateSubtreeInner(origNote, origBranch, newParentNoteId, noteIdMapping); - if (!res.note.title.endsWith('(dup)')) { - res.note.title += " (dup)"; + const duplicateNoteSuffix = t("notes.duplicate-note-suffix"); + + 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(); diff --git a/translations/en/server.json b/translations/en/server.json index f726aaa5d..c04fc52f9 100644 --- a/translations/en/server.json +++ b/translations/en/server.json @@ -242,6 +242,8 @@ "visible-launchers-title": "Visible Launchers" }, "notes": { - "new-note": "New note" + "new-note": "New note", + "duplicate-note-suffix": "(dup)", + "duplicate-note-title": "{{ noteTitle }} {{ duplicateNoteSuffix }}" } }