mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
client: Translate shared switch
This commit is contained in:
parent
a0fdaabb1f
commit
e4066ba164
@ -4,6 +4,7 @@ import server from "../services/server.js";
|
|||||||
import utils from "../services/utils.js";
|
import utils from "../services/utils.js";
|
||||||
import syncService from "../services/sync.js";
|
import syncService from "../services/sync.js";
|
||||||
import dialogService from "../services/dialog.js";
|
import dialogService from "../services/dialog.js";
|
||||||
|
import { t } from "../services/i18n.js";
|
||||||
|
|
||||||
export default class SharedSwitchWidget extends SwitchWidget {
|
export default class SharedSwitchWidget extends SwitchWidget {
|
||||||
isEnabled() {
|
isEnabled() {
|
||||||
@ -15,11 +16,11 @@ export default class SharedSwitchWidget extends SwitchWidget {
|
|||||||
doRender() {
|
doRender() {
|
||||||
super.doRender();
|
super.doRender();
|
||||||
|
|
||||||
this.$switchOnName.text("Shared");
|
this.$switchOnName.text(t("shared_switch.shared"));
|
||||||
this.$switchOnButton.attr("title", "Share the note");
|
this.$switchOnButton.attr("title", t("shared_switch.toggle-on-title"));
|
||||||
|
|
||||||
this.$switchOffName.text("Shared");
|
this.$switchOffName.text(t("shared_switch.shared"));
|
||||||
this.$switchOffButton.attr("title", "Unshare the note");
|
this.$switchOffButton.attr("title", t("shared_switch.toggle-off-title"));
|
||||||
|
|
||||||
this.$helpButton.attr("data-help-page", "sharing.html").show();
|
this.$helpButton.attr("data-help-page", "sharing.html").show();
|
||||||
this.$helpButton.on('click', e => utils.openHelp($(e.target)));
|
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) {
|
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(t("shared_switch.shared-branch"))) {
|
||||||
|
|
||||||
if (!await dialogService.confirm(text)) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -60,7 +59,7 @@ export default class SharedSwitchWidget extends SwitchWidget {
|
|||||||
this.$switchOff.toggle(!!isShared);
|
this.$switchOff.toggle(!!isShared);
|
||||||
|
|
||||||
if (switchDisabled) {
|
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");
|
this.$switchOff.addClass("switch-disabled");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -1305,5 +1305,12 @@
|
|||||||
"toggle-off": "Unprotect the note",
|
"toggle-off": "Unprotect the note",
|
||||||
"toggle-on-hint": "Note is not protected, click to make it protected",
|
"toggle-on-hint": "Note is not protected, click to make it protected",
|
||||||
"toggle-off-hint": "Note is protected, click to make it unprotected"
|
"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."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1305,5 +1305,12 @@
|
|||||||
"toggle-off-hint": "Notița este protejată, click pentru a o deproteja",
|
"toggle-off-hint": "Notița este protejată, click pentru a o deproteja",
|
||||||
"toggle-on": "Protejează notița",
|
"toggle-on": "Protejează notița",
|
||||||
"toggle-on-hint": "Notița nu este protejată, clic pentru a o proteja"
|
"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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user