mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
add translation for ribbon widgets: promoted_attributes.js
This commit is contained in:
parent
2916182cdf
commit
b7809a709c
@ -1,3 +1,4 @@
|
|||||||
|
import { t } from "../../services/i18n.js";
|
||||||
import server from "../../services/server.js";
|
import server from "../../services/server.js";
|
||||||
import ws from "../../services/ws.js";
|
import ws from "../../services/ws.js";
|
||||||
import treeService from "../../services/tree.js";
|
import treeService from "../../services/tree.js";
|
||||||
@ -76,7 +77,7 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
|||||||
return {
|
return {
|
||||||
show: true,
|
show: true,
|
||||||
activate: options.is('promotedAttributesOpenInRibbon'),
|
activate: options.is('promotedAttributesOpenInRibbon'),
|
||||||
title: "Promoted Attributes",
|
title: t('promoted_attributes.promoted_attributes'),
|
||||||
icon: "bx bx-table"
|
icon: "bx bx-table"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -221,11 +222,11 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
|||||||
$input.prop('type', 'datetime-local')
|
$input.prop('type', 'datetime-local')
|
||||||
}
|
}
|
||||||
else if (definition.labelType === 'url') {
|
else if (definition.labelType === 'url') {
|
||||||
$input.prop("placeholder", "http://website...");
|
$input.prop("placeholder", t("promoted_attributes.url_placeholder"));
|
||||||
|
|
||||||
const $openButton = $("<span>")
|
const $openButton = $("<span>")
|
||||||
.addClass("input-group-text open-external-link-button bx bx-window-open")
|
.addClass("input-group-text open-external-link-button bx bx-window-open")
|
||||||
.prop("title", "Open external link")
|
.prop("title", t("promoted_attributes.open_external_link"))
|
||||||
.on('click', () => window.open($input.val(), '_blank'));
|
.on('click', () => window.open($input.val(), '_blank'));
|
||||||
|
|
||||||
$input.after($("<div>")
|
$input.after($("<div>")
|
||||||
@ -233,7 +234,7 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
|||||||
.append($openButton));
|
.append($openButton));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ws.logError(`Unknown labelType '${definitionAttr.labelType}'`);
|
ws.logError(t("promoted_attributes.unknown_label_type", { type: definitionAttr.labelType }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (valueAttr.type === 'relation') {
|
else if (valueAttr.type === 'relation') {
|
||||||
@ -256,14 +257,14 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ws.logError(`Unknown attribute type '${valueAttr.type}'`);
|
ws.logError(t(`promoted_attributes.unknown_attribute_type`, {type: valueAttr.type}));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (definition.multiplicity === "multi") {
|
if (definition.multiplicity === "multi") {
|
||||||
const $addButton = $("<span>")
|
const $addButton = $("<span>")
|
||||||
.addClass("bx bx-plus pointer")
|
.addClass("bx bx-plus pointer")
|
||||||
.prop("title", "Add new attribute")
|
.prop("title", t("promoted_attributes.add_new_attribute"))
|
||||||
.on('click', async () => {
|
.on('click', async () => {
|
||||||
const $new = await this.createPromotedAttributeCell(definitionAttr, {
|
const $new = await this.createPromotedAttributeCell(definitionAttr, {
|
||||||
attributeId: "",
|
attributeId: "",
|
||||||
@ -279,7 +280,7 @@ export default class PromotedAttributesWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
const $removeButton = $("<span>")
|
const $removeButton = $("<span>")
|
||||||
.addClass("bx bx-trash pointer")
|
.addClass("bx bx-trash pointer")
|
||||||
.prop("title", "Remove this attribute")
|
.prop("title", t("promoted_attributes.remove_this_attribute"))
|
||||||
.on('click', async () => {
|
.on('click', async () => {
|
||||||
const attributeId = $input.attr("data-attribute-id");
|
const attributeId = $input.attr("data-attribute-id");
|
||||||
|
|
||||||
|
@ -737,5 +737,14 @@
|
|||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "拥有的属性"
|
"owned_attributes": "拥有的属性"
|
||||||
|
},
|
||||||
|
"promoted_attributes": {
|
||||||
|
"promoted_attributes": "升级属性",
|
||||||
|
"url_placeholder": "http://网站链接...",
|
||||||
|
"open_external_link": "打开外部链接",
|
||||||
|
"unknown_label_type": "未知的标签类型 '{{type}}'",
|
||||||
|
"unknown_attribute_type": "未知的属性类型 '{{type}}'",
|
||||||
|
"add_new_attribute": "添加新属性",
|
||||||
|
"remove_this_attribute": "移除此属性"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -738,5 +738,14 @@
|
|||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Owned Attributes"
|
"owned_attributes": "Owned Attributes"
|
||||||
|
},
|
||||||
|
"promoted_attributes": {
|
||||||
|
"promoted_attributes": "Promoted Attributes",
|
||||||
|
"url_placeholder": "http://website...",
|
||||||
|
"open_external_link": "Open external link",
|
||||||
|
"unknown_label_type": "Unknown labelType '{{type}}'",
|
||||||
|
"unknown_attribute_type": "Unknown attribute type '{{type}}'",
|
||||||
|
"add_new_attribute": "Add new attribute",
|
||||||
|
"remove_this_attribute": "Remove this attribute"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user