diff --git a/src/public/app/widgets/dialogs/clone_to.js b/src/public/app/widgets/dialogs/clone_to.js index 445f408ea..8268668e4 100644 --- a/src/public/app/widgets/dialogs/clone_to.js +++ b/src/public/app/widgets/dialogs/clone_to.js @@ -6,7 +6,7 @@ import froca from "../../services/froca.js"; import branchService from "../../services/branches.js"; import appContext from "../../components/app_context.js"; import BasicWidget from "../basic_widget.js"; -import { t } from "../../services/i18n.js"; // Added import for i18n +import { t } from "../../services/i18n.js"; const TPL = ` @@ -141,8 +142,7 @@ export default class ExportDialog extends BasicWidget { const exportType = this.$widget.find("input[name='export-type']:checked").val(); if (!exportType) { - // this shouldn't happen as we always choose a default export type - toastService.showError("Choose export type first please"); + toastService.showError(t('export.choose_export_type')); return; } @@ -189,14 +189,12 @@ export default class ExportDialog extends BasicWidget { } async showExportDialogEvent({notePath, defaultType}) { - // each opening of the dialog resets the taskId, so we don't associate it with previous exports anymore this.taskId = ''; this.$exportButton.removeAttr("disabled"); if (defaultType === 'subtree') { this.$subtreeType.prop("checked", true).trigger('change'); - // to show/hide OPML versions this.$widget.find("input[name=export-subtree-format]:checked").trigger('change'); } else if (defaultType === 'single') { @@ -228,7 +226,7 @@ export default class ExportDialog extends BasicWidget { ws.subscribeToMessages(async message => { const makeToast = (id, message) => ({ id: id, - title: "Export status", + title: t('export.export_status'), message: message, icon: "arrow-square-up-right" }); @@ -242,10 +240,10 @@ ws.subscribeToMessages(async message => { toastService.showError(message.message); } else if (message.type === 'taskProgressCount') { - toastService.showPersistent(makeToast(message.taskId, `Export in progress: ${message.progressCount}`)); + toastService.showPersistent(makeToast(message.taskId, t('export.export_in_progress', { progressCount: message.progressCount }))); } else if (message.type === 'taskSucceeded') { - const toast = makeToast(message.taskId, "Export finished successfully."); + const toast = makeToast(message.taskId, t('export.export_finished_successfully')); toast.closeAfter = 5000; toastService.showPersistent(toast); diff --git a/src/public/app/widgets/dialogs/help.js b/src/public/app/widgets/dialogs/help.js index d3f8ecf4f..8a6822db8 100644 --- a/src/public/app/widgets/dialogs/help.js +++ b/src/public/app/widgets/dialogs/help.js @@ -1,14 +1,15 @@ import utils from "../../services/utils.js"; import BasicWidget from "../basic_widget.js"; +import { t } from "../../services/i18n.js"; const TPL = `