mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
add translation for bookmark_switch.js and editability_select.js
This commit is contained in:
parent
0198f135ac
commit
8e87bcf37b
@ -1,6 +1,7 @@
|
|||||||
import SwitchWidget from "./switch.js";
|
import SwitchWidget from "./switch.js";
|
||||||
import server from "../services/server.js";
|
import server from "../services/server.js";
|
||||||
import toastService from "../services/toast.js";
|
import toastService from "../services/toast.js";
|
||||||
|
import { t } from "../services/i18n.js";
|
||||||
|
|
||||||
export default class BookmarkSwitchWidget extends SwitchWidget {
|
export default class BookmarkSwitchWidget extends SwitchWidget {
|
||||||
isEnabled() {
|
isEnabled() {
|
||||||
@ -12,11 +13,11 @@ export default class BookmarkSwitchWidget extends SwitchWidget {
|
|||||||
doRender() {
|
doRender() {
|
||||||
super.doRender();
|
super.doRender();
|
||||||
|
|
||||||
this.$switchOnName.text("Bookmark");
|
this.$switchOnName.text(t("bookmark_switch.bookmark"));
|
||||||
this.$switchOnButton.attr("title", "Bookmark this note to the left side panel");
|
this.$switchOnButton.attr("title", t("bookmark_switch.bookmark_this_note"));
|
||||||
|
|
||||||
this.$switchOffName.text("Bookmark");
|
this.$switchOffName.text(t("bookmark_switch.bookmark"));
|
||||||
this.$switchOffButton.attr("title", "Remove bookmark");
|
this.$switchOffButton.attr("title", t("bookmark_switch.remove_bookmark"));
|
||||||
}
|
}
|
||||||
|
|
||||||
async toggle(state) {
|
async toggle(state) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import attributeService from '../services/attributes.js';
|
import attributeService from '../services/attributes.js';
|
||||||
import NoteContextAwareWidget from "./note_context_aware_widget.js";
|
import NoteContextAwareWidget from "./note_context_aware_widget.js";
|
||||||
|
import { t } from "../services/i18n.js";
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="dropdown editability-select-widget">
|
<div class="dropdown editability-select-widget">
|
||||||
@ -15,24 +16,24 @@ const TPL = `
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<button type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn btn-sm dropdown-toggle editability-button">
|
<button type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" class="btn btn-sm dropdown-toggle editability-button">
|
||||||
<span class="editability-active-desc">auto</span>
|
<span class="editability-active-desc">${t("editability_select.auto")}</span>
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="editability-dropdown dropdown-menu dropdown-menu-right">
|
<div class="editability-dropdown dropdown-menu dropdown-menu-right">
|
||||||
<a class="dropdown-item" href="#" data-editability="auto">
|
<a class="dropdown-item" href="#" data-editability="auto">
|
||||||
<span class="check">✓</span>
|
<span class="check">✓</span>
|
||||||
Auto
|
${t("editability_select.auto")}
|
||||||
<div>Note is editable if it's not too long.</div>
|
<div>${t("editability_select.note_is_editable")}</div>
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item" href="#" data-editability="readOnly">
|
<a class="dropdown-item" href="#" data-editability="readOnly">
|
||||||
<span class="check">✓</span>
|
<span class="check">✓</span>
|
||||||
Read-only
|
${t("editability_select.read_only")}
|
||||||
<div>Note is read-only, but can be edited with a button click.</div>
|
<div>${t("editability_select.note_is_read_only")}</div>
|
||||||
</a>
|
</a>
|
||||||
<a class="dropdown-item" href="#" data-editability="autoReadOnlyDisabled">
|
<a class="dropdown-item" href="#" data-editability="autoReadOnlyDisabled">
|
||||||
<span class="check">✓</span>
|
<span class="check">✓</span>
|
||||||
Always editable
|
${t("editability_select.always_editable")}
|
||||||
<div>Note is always editable, regardless of its length.</div>
|
<div>${t("editability_select.note_is_always_editable")}</div>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -73,9 +74,9 @@ export default class EditabilitySelectWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const labels = {
|
const labels = {
|
||||||
"auto": "Auto",
|
"auto": t("editability_select.auto"),
|
||||||
"readOnly": "Read-only",
|
"readOnly": t("editability_select.read_only"),
|
||||||
"autoReadOnlyDisabled": "Always Editable"
|
"autoReadOnlyDisabled": t("editability_select.always_editable")
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$widget.find('.dropdown-item').removeClass("selected");
|
this.$widget.find('.dropdown-item').removeClass("selected");
|
||||||
|
@ -1229,5 +1229,18 @@
|
|||||||
"role_and_size": "角色: {{role}}, 大小: {{size}}",
|
"role_and_size": "角色: {{role}}, 大小: {{size}}",
|
||||||
"link_copied": "附件链接已复制到剪贴板。",
|
"link_copied": "附件链接已复制到剪贴板。",
|
||||||
"unrecognized_role": "无法识别的附件角色 '{{role}}'。"
|
"unrecognized_role": "无法识别的附件角色 '{{role}}'。"
|
||||||
|
},
|
||||||
|
"bookmark_switch": {
|
||||||
|
"bookmark": "书签",
|
||||||
|
"bookmark_this_note": "将此笔记添加到左侧面板的书签",
|
||||||
|
"remove_bookmark": "移除书签"
|
||||||
|
},
|
||||||
|
"editability_select": {
|
||||||
|
"auto": "自动",
|
||||||
|
"read_only": "只读",
|
||||||
|
"always_editable": "始终可编辑",
|
||||||
|
"note_is_editable": "笔记如果不太长则可编辑。",
|
||||||
|
"note_is_read_only": "笔记为只读,但可以通过点击按钮进行编辑。",
|
||||||
|
"note_is_always_editable": "无论笔记长度如何,始终可编辑。"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1229,5 +1229,18 @@
|
|||||||
"role_and_size": "Role: {{role}}, Size: {{size}}",
|
"role_and_size": "Role: {{role}}, Size: {{size}}",
|
||||||
"link_copied": "Attachment link copied to clipboard.",
|
"link_copied": "Attachment link copied to clipboard.",
|
||||||
"unrecognized_role": "Unrecognized attachment role '{{role}}'."
|
"unrecognized_role": "Unrecognized attachment role '{{role}}'."
|
||||||
|
},
|
||||||
|
"bookmark_switch": {
|
||||||
|
"bookmark": "Bookmark",
|
||||||
|
"bookmark_this_note": "Bookmark this note to the left side panel",
|
||||||
|
"remove_bookmark": "Remove bookmark"
|
||||||
|
},
|
||||||
|
"editability_select": {
|
||||||
|
"auto": "Auto",
|
||||||
|
"read_only": "Read-only",
|
||||||
|
"always_editable": "Always Editable",
|
||||||
|
"note_is_editable": "Note is editable if it's not too long.",
|
||||||
|
"note_is_read_only": "Note is read-only, but can be edited with a button click.",
|
||||||
|
"note_is_always_editable": "Note is always editable, regardless of its length."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user