@@ -274,7 +274,7 @@ export default class RevisionsDialog extends BasicWidget {
}
this.$content.html($table);
- } else if (revisionItem.type === 'canvas') {
+ } else if ([ "canvas", "mindMap" ].includes(revisionItem.type)) {
const encodedTitle = encodeURIComponent(revisionItem.title);
this.$content.html($("
")
diff --git a/src/public/app/widgets/note_map.js b/src/public/app/widgets/note_map.js
index ab7d2c0e0..f4b00dc81 100644
--- a/src/public/app/widgets/note_map.js
+++ b/src/public/app/widgets/note_map.js
@@ -6,6 +6,7 @@ import appContext from "../components/app_context.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js";
import linkContextMenuService from "../menus/link_context_menu.js";
import utils from "../services/utils.js";
+import { t } from "../services/i18n.js";
const esc = utils.escapeHtml;
@@ -30,8 +31,8 @@ const TPL = `
-
-
+
+
diff --git a/src/public/app/widgets/note_type.js b/src/public/app/widgets/note_type.js
index 66e699eff..1bf121888 100644
--- a/src/public/app/widgets/note_type.js
+++ b/src/public/app/widgets/note_type.js
@@ -2,25 +2,26 @@ import server from '../services/server.js';
import mimeTypesService from '../services/mime_types.js';
import NoteContextAwareWidget from "./note_context_aware_widget.js";
import dialogService from "../services/dialog.js";
+import { t } from '../services/i18n.js';
const NOTE_TYPES = [
- { type: "file", title: "File", selectable: false },
- { type: "image", title: "Image", selectable: false },
- { type: "search", title: "Saved Search", selectable: false },
- { type: "noteMap", mime: '', title: "Note Map", selectable: false },
- { type: "launcher", mime: '', title: "Launcher", selectable: false },
- { type: "doc", mime: '', title: "Doc", selectable: false },
- { type: "contentWidget", mime: '', title: "Widget", selectable: false },
+ { type: "file", title: t("note_types.file"), selectable: false },
+ { type: "image", title: t("note_types.image"), selectable: false },
+ { type: "search", title: t("note_types.saved-search"), selectable: false },
+ { type: "noteMap", mime: '', title: t("note_types.note-map"), selectable: false },
+ { type: "launcher", mime: '', title: t("note_types.launcher"), selectable: false },
+ { type: "doc", mime: '', title: t("note_types.doc"), selectable: false },
+ { type: "contentWidget", mime: '', title: t("note_types.widget"), selectable: false },
- { type: "text", mime: "text/html", title: "Text", selectable: true },
- { type: "relationMap", mime: "application/json", title: "Relation Map", selectable: true },
- { type: "mindMap", mime: "application/json", "title": "Mind Map", selectable: true },
- { type: "render", mime: '', title: "Render Note", selectable: true },
- { type: "canvas", mime: 'application/json', title: "Canvas", selectable: true },
- { type: "mermaid", mime: 'text/mermaid', title: "Mermaid Diagram", selectable: true },
- { type: "book", mime: '', title: "Book", selectable: true },
- { type: "webView", mime: '', title: "Web View", selectable: true },
- { type: "code", mime: 'text/plain', title: "Code", selectable: true }
+ { type: "text", mime: "text/html", title: t("note_types.text"), selectable: true },
+ { type: "relationMap", mime: "application/json", title: t("note_types.relation-map"), selectable: true },
+ { type: "mindMap", mime: "application/json", "title": t("note_types.mind-map"), selectable: true },
+ { type: "render", mime: '', title: t("note_types.render-note"), selectable: true },
+ { type: "canvas", mime: 'application/json', title: t("note_types.canvas"), selectable: true },
+ { type: "mermaid", mime: 'text/mermaid', title: t("note_types.mermaid-diagram"), selectable: true },
+ { type: "book", mime: '', title: t("note_types.book"), selectable: true },
+ { type: "webView", mime: '', title: t("note_types.web-view"), selectable: true },
+ { type: "code", mime: 'text/plain', title: t("note_types.code"), selectable: true }
];
const NOT_SELECTABLE_NOTE_TYPES = NOTE_TYPES.filter(nt => !nt.selectable).map(nt => nt.type);
diff --git a/src/public/app/widgets/protected_note_switch.js b/src/public/app/widgets/protected_note_switch.js
index e06bf973d..c7cd5c41a 100644
--- a/src/public/app/widgets/protected_note_switch.js
+++ b/src/public/app/widgets/protected_note_switch.js
@@ -1,3 +1,4 @@
+import { t } from "../services/i18n.js";
import protectedSessionService from "../services/protected_session.js";
import SwitchWidget from "./switch.js";
@@ -5,11 +6,11 @@ export default class ProtectedNoteSwitchWidget extends SwitchWidget {
doRender() {
super.doRender();
- this.$switchOnName.text("Protect the note");
- this.$switchOnButton.attr("title", "Note is not protected, click to make it protected");
+ this.$switchOnName.text(t("protect_note.toggle-on"));
+ this.$switchOnButton.attr("title", t("protect_note.toggle-on-hint"));
- this.$switchOffName.text("Unprotect the note");
- this.$switchOffButton.attr("title", "Note is protected, click to make it unprotected");
+ this.$switchOffName.text(t("protect_note.toggle-off"));
+ this.$switchOffButton.attr("title", t("protect_note.toggle-off-hint"));
}
switchOn() {
diff --git a/src/public/app/widgets/shared_info.js b/src/public/app/widgets/shared_info.js
index 9183a5c2c..e6a6ad33e 100644
--- a/src/public/app/widgets/shared_info.js
+++ b/src/public/app/widgets/shared_info.js
@@ -1,6 +1,7 @@
import NoteContextAwareWidget from "./note_context_aware_widget.js";
import options from "../services/options.js";
import attributeService from "../services/attributes.js";
+import { t } from "../services/i18n.js";
const TPL = `
`;
export default class SharedInfoWidget extends NoteContextAwareWidget {
@@ -36,7 +37,7 @@ export default class SharedInfoWidget extends NoteContextAwareWidget {
if (syncServerHost) {
link = `${syncServerHost}/share/${shareId}`;
- this.$sharedText.text("This note is shared publicly on");
+ this.$sharedText.text(t("shared_info.shared_publicly"));
}
else {
let host = location.host;
@@ -47,7 +48,7 @@ export default class SharedInfoWidget extends NoteContextAwareWidget {
}
link = `${location.protocol}//${host}${location.pathname}share/${shareId}`;
- this.$sharedText.text("This note is shared locally on");
+ this.$sharedText.text(t("shared_info.shared_locally"));
}
this.$sharedLink.attr("href", link).text(link);
diff --git a/src/public/app/widgets/shared_switch.js b/src/public/app/widgets/shared_switch.js
index 65f654c14..2a51eddc8 100644
--- a/src/public/app/widgets/shared_switch.js
+++ b/src/public/app/widgets/shared_switch.js
@@ -4,6 +4,7 @@ import server from "../services/server.js";
import utils from "../services/utils.js";
import syncService from "../services/sync.js";
import dialogService from "../services/dialog.js";
+import { t } from "../services/i18n.js";
export default class SharedSwitchWidget extends SwitchWidget {
isEnabled() {
@@ -15,11 +16,11 @@ export default class SharedSwitchWidget extends SwitchWidget {
doRender() {
super.doRender();
- this.$switchOnName.text("Shared");
- this.$switchOnButton.attr("title", "Share the note");
+ this.$switchOnName.text(t("shared_switch.shared"));
+ this.$switchOnButton.attr("title", t("shared_switch.toggle-on-title"));
- this.$switchOffName.text("Shared");
- this.$switchOffButton.attr("title", "Unshare the note");
+ this.$switchOffName.text(t("shared_switch.shared"));
+ this.$switchOffButton.attr("title", t("shared_switch.toggle-off-title"));
this.$helpButton.attr("data-help-page", "sharing.html").show();
this.$helpButton.on('click', e => utils.openHelp($(e.target)));
@@ -39,9 +40,7 @@ export default class SharedSwitchWidget extends SwitchWidget {
}
if (this.note.getParentBranches().length === 1) {
- const text = "This note exists only as a shared note, unsharing would delete it. Do you want to continue and thus delete this note?";
-
- if (!await dialogService.confirm(text)) {
+ if (!await dialogService.confirm(t("shared_switch.shared-branch"))) {
return;
}
}
@@ -60,7 +59,7 @@ export default class SharedSwitchWidget extends SwitchWidget {
this.$switchOff.toggle(!!isShared);
if (switchDisabled) {
- this.$widget.attr("title", "Note cannot be unshared here because it is shared through inheritance from an ancestor.");
+ this.$widget.attr("title", t("shared_switch.inherited"));
this.$switchOff.addClass("switch-disabled");
}
else {
diff --git a/src/public/app/widgets/switch.js b/src/public/app/widgets/switch.js
index e70fb5612..c59126f81 100644
--- a/src/public/app/widgets/switch.js
+++ b/src/public/app/widgets/switch.js
@@ -1,3 +1,4 @@
+import { t } from "../services/i18n.js";
import NoteContextAwareWidget from "./note_context_aware_widget.js";
const TPL = `
@@ -90,7 +91,7 @@ const TPL = `