add translation for 6 more dialogs

This commit is contained in:
Nriver
2024-07-24 17:34:26 +08:00
parent 5691554442
commit a8d6e5b1ea
8 changed files with 118 additions and 40 deletions

View File

@@ -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 = `
<div class="move-to-dialog modal mx-auto" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" style="max-width: 1000px" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title mr-auto">Move notes to ...</h5>
<h5 class="modal-title mr-auto">${t("move_to.dialog_title")}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" style="margin-left: 0 !important;">
<span aria-hidden="true">&times;</span>
@@ -19,21 +20,21 @@ const TPL = `
</div>
<form class="move-to-form">
<div class="modal-body">
<h5>Notes to move</h5>
<h5>${t("move_to.notes_to_move")}</h5>
<ul class="move-to-note-list" style="max-height: 200px; overflow: auto;"></ul>
<div class="form-group">
<label style="width: 100%">
Target parent note
${t("move_to.target_parent_note")}
<div class="input-group">
<input class="move-to-note-autocomplete form-control" placeholder="search for note by its name">
<input class="move-to-note-autocomplete form-control" placeholder="${t("move_to.search_placeholder")}">
</div>
</label>
</div>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary">Move to selected note <kbd>enter</kbd></button>
<button type="submit" class="btn btn-primary">${t("move_to.move_button")}</button>
</div>
</form>
</div>
@@ -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}`);
}
}