mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-12 20:02:28 +08:00
feat(i18n): translate import toast messages
This commit is contained in:
parent
b3b8e60192
commit
38b4b3953d
@ -3,6 +3,7 @@ import server from "./server.js";
|
|||||||
import ws from "./ws.js";
|
import ws from "./ws.js";
|
||||||
import utils from "./utils.js";
|
import utils from "./utils.js";
|
||||||
import appContext from "../components/app_context.js";
|
import appContext from "../components/app_context.js";
|
||||||
|
import { t } from "./i18n.js";
|
||||||
|
|
||||||
export async function uploadFiles(entityType, parentNoteId, files, options) {
|
export async function uploadFiles(entityType, parentNoteId, files, options) {
|
||||||
if (!['notes', 'attachments'].includes(entityType)) {
|
if (!['notes', 'attachments'].includes(entityType)) {
|
||||||
@ -47,7 +48,7 @@ export async function uploadFiles(entityType, parentNoteId, files, options) {
|
|||||||
function makeToast(id, message) {
|
function makeToast(id, message) {
|
||||||
return {
|
return {
|
||||||
id: id,
|
id: id,
|
||||||
title: "Import status",
|
title: t("import.import-status"),
|
||||||
message: message,
|
message: message,
|
||||||
icon: "plus"
|
icon: "plus"
|
||||||
};
|
};
|
||||||
@ -62,9 +63,9 @@ ws.subscribeToMessages(async message => {
|
|||||||
toastService.closePersistent(message.taskId);
|
toastService.closePersistent(message.taskId);
|
||||||
toastService.showError(message.message);
|
toastService.showError(message.message);
|
||||||
} else if (message.type === 'taskProgressCount') {
|
} else if (message.type === 'taskProgressCount') {
|
||||||
toastService.showPersistent(makeToast(message.taskId, `Import in progress: ${message.progressCount}`));
|
toastService.showPersistent(makeToast(message.taskId, t("import.in-progress", { progress: message.progressCount })));
|
||||||
} else if (message.type === 'taskSucceeded') {
|
} else if (message.type === 'taskSucceeded') {
|
||||||
const toast = makeToast(message.taskId, "Import finished successfully.");
|
const toast = makeToast(message.taskId, t("import.successful"));
|
||||||
toast.closeAfter = 5000;
|
toast.closeAfter = 5000;
|
||||||
|
|
||||||
toastService.showPersistent(toast);
|
toastService.showPersistent(toast);
|
||||||
@ -84,9 +85,9 @@ ws.subscribeToMessages(async message => {
|
|||||||
toastService.closePersistent(message.taskId);
|
toastService.closePersistent(message.taskId);
|
||||||
toastService.showError(message.message);
|
toastService.showError(message.message);
|
||||||
} else if (message.type === 'taskProgressCount') {
|
} else if (message.type === 'taskProgressCount') {
|
||||||
toastService.showPersistent(makeToast(message.taskId, `Import in progress: ${message.progressCount}`));
|
toastService.showPersistent(makeToast(message.taskId, t("import.in-progress", { progress: message.progressCount })));
|
||||||
} else if (message.type === 'taskSucceeded') {
|
} else if (message.type === 'taskSucceeded') {
|
||||||
const toast = makeToast(message.taskId, "Import finished successfully.");
|
const toast = makeToast(message.taskId, t("import.successful"));
|
||||||
toast.closeAfter = 5000;
|
toast.closeAfter = 5000;
|
||||||
|
|
||||||
toastService.showPersistent(toast);
|
toastService.showPersistent(toast);
|
||||||
|
@ -182,7 +182,10 @@
|
|||||||
"placeholder": "Enter HTML tags, one per line",
|
"placeholder": "Enter HTML tags, one per line",
|
||||||
"help": "Enter HTML tags to preserve during import. Some tags (like 'script') are always removed for security.",
|
"help": "Enter HTML tags to preserve during import. Some tags (like 'script') are always removed for security.",
|
||||||
"reset_button": "Reset to Default List"
|
"reset_button": "Reset to Default List"
|
||||||
}
|
},
|
||||||
|
"import-status": "Import status",
|
||||||
|
"in-progress": "Import in progress: {{progress}}",
|
||||||
|
"successful": "Import finished successfully."
|
||||||
},
|
},
|
||||||
"include_note": {
|
"include_note": {
|
||||||
"dialog_title": "Include note",
|
"dialog_title": "Include note",
|
||||||
|
@ -692,7 +692,10 @@
|
|||||||
"shrinkImages": "Micșorare imagini",
|
"shrinkImages": "Micșorare imagini",
|
||||||
"shrinkImagesTooltip": "<p>Dacă bifați această opțiune, Trilium va încerca să micșoreze imaginea importată prin scalarea și importarea ei, aspect ce poate afecta calitatea aparentă a imaginii. Dacă nu este bifat, imaginile vor fi importate fără nicio modificare.</p><p>Acest lucru nu se aplică la importuri de tip <code>.zip</code> cu metainformații deoarece se asumă că aceste fișiere sunt deja optimizate.</p>",
|
"shrinkImagesTooltip": "<p>Dacă bifați această opțiune, Trilium va încerca să micșoreze imaginea importată prin scalarea și importarea ei, aspect ce poate afecta calitatea aparentă a imaginii. Dacă nu este bifat, imaginile vor fi importate fără nicio modificare.</p><p>Acest lucru nu se aplică la importuri de tip <code>.zip</code> cu metainformații deoarece se asumă că aceste fișiere sunt deja optimizate.</p>",
|
||||||
"textImportedAsText": "Importă HTML, Markdown și TXT ca notițe de tip text dacă este neclar din metainformații",
|
"textImportedAsText": "Importă HTML, Markdown și TXT ca notițe de tip text dacă este neclar din metainformații",
|
||||||
"failed": "Eroare la importare: {{message}}."
|
"failed": "Eroare la importare: {{message}}.",
|
||||||
|
"import-status": "Starea importului",
|
||||||
|
"in-progress": "Import în curs: {{progress}}",
|
||||||
|
"successful": "Import finalizat cu succes."
|
||||||
},
|
},
|
||||||
"include_archived_notes": {
|
"include_archived_notes": {
|
||||||
"include_archived_notes": "Include notițele arhivate"
|
"include_archived_notes": "Include notițele arhivate"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user