Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
client: Translate shared switch
Elian Dorane4066ba16493
diff --git a/src/public/app/widgets/shared_switch.js b/src/public/app/widgets/shared_switch.jsindex 65f654c142..2a51eddc87 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/translations/en/translation.json b/src/public/translations/en/translation.jsonindex 48a0fd5cc1..7bafb379fc 100644--- a/src/public/translations/en/translation.json+++ b/src/public/translations/en/translation.json@@ -1305,5 +1305,12 @@"toggle-off": "Unprotect the note","toggle-on-hint": "Note is not protected, click to make it protected","toggle-off-hint": "Note is protected, click to make it unprotected"+ },+ "shared_switch": {+ "shared": "Shared",+ "toggle-on-title": "Share the note",+ "toggle-off-title": "Unshare the note",+ "shared-branch": "This note exists only as a shared note, unsharing would delete it. Do you want to continue and thus delete this note?",+ "inherited": "Note cannot be unshared here because it is shared through inheritance from an ancestor."}}diff --git a/src/public/translations/ro/translation.json b/src/public/translations/ro/translation.jsonindex 6cf3863af4..be7f09cea6 100644--- a/src/public/translations/ro/translation.json+++ b/src/public/translations/ro/translation.json@@ -1305,5 +1305,12 @@"toggle-off-hint": "Notița este protejată, click pentru a o deproteja","toggle-on": "Protejează notița","toggle-on-hint": "Notița nu este protejată, clic pentru a o proteja"+ },+ "shared_switch": {+ "inherited": "Nu se poate înlătura partajarea deoarece notița este partajată prin moștenirea de la o notiță părinte.",+ "shared": "Partajată",+ "shared-branch": "Această notiță există doar ca o notiță partajată, anularea partajării ar cauza ștergerea ei. Sigur doriți ștergerea notiței?",+ "toggle-off-title": "Anulează partajarea notițeii",+ "toggle-on-title": "Partajează notița"}}