mirror of
https://github.com/zadam/trilium.git
synced 2025-10-07 05:58:55 +08:00
feat(collections): add i18n
This commit is contained in:
parent
736bc9c9bd
commit
9ddd1a4ae2
4 changed files with 32 additions and 15 deletions
|
@ -81,7 +81,7 @@ let rootCreationDate: Date | undefined;
|
||||||
async function getNoteTypeItems(command?: TreeCommandNames) {
|
async function getNoteTypeItems(command?: TreeCommandNames) {
|
||||||
const items: MenuItem<TreeCommandNames>[] = [
|
const items: MenuItem<TreeCommandNames>[] = [
|
||||||
...getBlankNoteTypes(command),
|
...getBlankNoteTypes(command),
|
||||||
...await getBuiltInTemplates("Collections", command, true),
|
...await getBuiltInTemplates(t("note_types.collections"), command, true),
|
||||||
...await getBuiltInTemplates(null, command, false),
|
...await getBuiltInTemplates(null, command, false),
|
||||||
...await getUserTemplates(command)
|
...await getUserTemplates(command)
|
||||||
];
|
];
|
||||||
|
|
|
@ -1629,7 +1629,8 @@
|
||||||
"beta-feature": "Beta",
|
"beta-feature": "Beta",
|
||||||
"ai-chat": "AI Chat",
|
"ai-chat": "AI Chat",
|
||||||
"task-list": "Task List",
|
"task-list": "Task List",
|
||||||
"new-feature": "New"
|
"new-feature": "New",
|
||||||
|
"collections": "Collections"
|
||||||
},
|
},
|
||||||
"protect_note": {
|
"protect_note": {
|
||||||
"toggle-on": "Protect the note",
|
"toggle-on": "Protect the note",
|
||||||
|
|
|
@ -303,5 +303,20 @@
|
||||||
"subpages": "Subpages:",
|
"subpages": "Subpages:",
|
||||||
"on-this-page": "On This Page",
|
"on-this-page": "On This Page",
|
||||||
"expand": "Expand"
|
"expand": "Expand"
|
||||||
|
},
|
||||||
|
"hidden_subtree_templates": {
|
||||||
|
"text-snippet": "Text Snippet",
|
||||||
|
"description": "Description",
|
||||||
|
"list-view": "List View",
|
||||||
|
"grid-view": "Grid View",
|
||||||
|
"calendar": "Calendar",
|
||||||
|
"table": "Table",
|
||||||
|
"geo-map": "Geo Map",
|
||||||
|
"start-date": "Start Date",
|
||||||
|
"end-date": "End Date",
|
||||||
|
"start-time": "Start Time",
|
||||||
|
"end-time": "End Time",
|
||||||
|
"geolocation": "Geolocation",
|
||||||
|
"built-in-templates": "Built-in templates"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
import { HiddenSubtreeItem } from "@triliumnext/commons";
|
import { HiddenSubtreeItem } from "@triliumnext/commons";
|
||||||
|
import { t } from "i18next";
|
||||||
|
|
||||||
export default function buildHiddenSubtreeTemplates() {
|
export default function buildHiddenSubtreeTemplates() {
|
||||||
const templates: HiddenSubtreeItem = {
|
const templates: HiddenSubtreeItem = {
|
||||||
id: "_templates",
|
id: "_templates",
|
||||||
title: "Built-in templates",
|
title: t("hidden_subtree_templates.built-in-templates"),
|
||||||
type: "book",
|
type: "book",
|
||||||
children: [
|
children: [
|
||||||
{
|
{
|
||||||
id: "_template_text_snippet",
|
id: "_template_text_snippet",
|
||||||
type: "text",
|
type: "text",
|
||||||
title: "Text Snippet",
|
title: t("hidden_subtree_templates.text-snippet"),
|
||||||
icon: "bx-align-left",
|
icon: "bx-align-left",
|
||||||
attributes: [
|
attributes: [
|
||||||
{
|
{
|
||||||
|
@ -23,14 +24,14 @@ export default function buildHiddenSubtreeTemplates() {
|
||||||
{
|
{
|
||||||
name: "label:textSnippetDescription",
|
name: "label:textSnippetDescription",
|
||||||
type: "label",
|
type: "label",
|
||||||
value: "promoted,alias=Description,single,text"
|
value: `promoted,alias=${t("hidden_subtree_templates.description")},single,text`
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "_template_list_view",
|
id: "_template_list_view",
|
||||||
type: "book",
|
type: "book",
|
||||||
title: "List View",
|
title: t("hidden_subtree_templates.list-view"),
|
||||||
icon: "bx bx-list-ul",
|
icon: "bx bx-list-ul",
|
||||||
attributes: [
|
attributes: [
|
||||||
{
|
{
|
||||||
|
@ -51,7 +52,7 @@ export default function buildHiddenSubtreeTemplates() {
|
||||||
{
|
{
|
||||||
id: "_template_grid_view",
|
id: "_template_grid_view",
|
||||||
type: "book",
|
type: "book",
|
||||||
title: "Grid View",
|
title: t("hidden_subtree_templates.grid-view"),
|
||||||
icon: "bx bxs-grid",
|
icon: "bx bxs-grid",
|
||||||
attributes: [
|
attributes: [
|
||||||
{
|
{
|
||||||
|
@ -72,7 +73,7 @@ export default function buildHiddenSubtreeTemplates() {
|
||||||
{
|
{
|
||||||
id: "_template_calendar",
|
id: "_template_calendar",
|
||||||
type: "book",
|
type: "book",
|
||||||
title: "Calendar",
|
title: t("hidden_subtree_templates.calendar"),
|
||||||
icon: "bx bx-calendar",
|
icon: "bx bx-calendar",
|
||||||
attributes: [
|
attributes: [
|
||||||
{
|
{
|
||||||
|
@ -95,25 +96,25 @@ export default function buildHiddenSubtreeTemplates() {
|
||||||
{
|
{
|
||||||
name: "label:startDate",
|
name: "label:startDate",
|
||||||
type: "label",
|
type: "label",
|
||||||
value: "promoted,alias=Start Date,single,date",
|
value: `promoted,alias=${t("hidden_subtree_templates.start-date")},single,date`,
|
||||||
isInheritable: true
|
isInheritable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "label:endDate",
|
name: "label:endDate",
|
||||||
type: "label",
|
type: "label",
|
||||||
value: "promoted,alias=End Date,single,date",
|
value: `promoted,alias=${t("hidden_subtree_templates.end-date")},single,date`,
|
||||||
isInheritable: true
|
isInheritable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "label:startTime",
|
name: "label:startTime",
|
||||||
type: "label",
|
type: "label",
|
||||||
value: "promoted,alias=Start Time,single,time",
|
value: `promoted,alias=${t("hidden_subtree_templates.start-time")},single,time`,
|
||||||
isInheritable: true
|
isInheritable: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "label:endTime",
|
name: "label:endTime",
|
||||||
type: "label",
|
type: "label",
|
||||||
value: "promoted,alias=End Time,single,time",
|
value: `promoted,alias=${t("hidden_subtree_templates.end-time")},single,time`,
|
||||||
isInheritable: true
|
isInheritable: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -121,7 +122,7 @@ export default function buildHiddenSubtreeTemplates() {
|
||||||
{
|
{
|
||||||
id: "_template_table",
|
id: "_template_table",
|
||||||
type: "book",
|
type: "book",
|
||||||
title: "Table",
|
title: t("hidden_subtree_templates.table"),
|
||||||
icon: "bx bx-table",
|
icon: "bx bx-table",
|
||||||
attributes: [
|
attributes: [
|
||||||
{
|
{
|
||||||
|
@ -142,7 +143,7 @@ export default function buildHiddenSubtreeTemplates() {
|
||||||
{
|
{
|
||||||
id: "_template_geo_map",
|
id: "_template_geo_map",
|
||||||
type: "book",
|
type: "book",
|
||||||
title: "Geo Map",
|
title: t("hidden_subtree_templates.geo-map"),
|
||||||
icon: "bx bx-map-alt",
|
icon: "bx bx-map-alt",
|
||||||
attributes: [
|
attributes: [
|
||||||
{
|
{
|
||||||
|
@ -165,7 +166,7 @@ export default function buildHiddenSubtreeTemplates() {
|
||||||
{
|
{
|
||||||
name: "label:geolocation",
|
name: "label:geolocation",
|
||||||
type: "label",
|
type: "label",
|
||||||
value: "promoted,alias=Geolocation,single,text",
|
value: `promoted,alias=${t("hidden_subtree_templates.geolocation")},single,text`,
|
||||||
isInheritable: true
|
isInheritable: true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Reference in a new issue