From c9d0d339eb860180dcb86da39c12b0c0ddad0bb1 Mon Sep 17 00:00:00 2001 From: Nriver <6752679+Nriver@users.noreply.github.com> Date: Fri, 9 Aug 2024 14:48:54 +0800 Subject: [PATCH] add translation for all text note options --- .../options/text_notes/heading_style.js | 9 +++--- .../options/text_notes/highlights_list.js | 21 +++++++------- .../options/text_notes/table_of_contents.js | 9 +++--- .../text_notes/text_auto_read_only_size.js | 7 +++-- src/public/translations/cn/translation.json | 29 +++++++++++++++++++ src/public/translations/en/translation.json | 29 +++++++++++++++++++ 6 files changed, 83 insertions(+), 21 deletions(-) diff --git a/src/public/app/widgets/type_widgets/options/text_notes/heading_style.js b/src/public/app/widgets/type_widgets/options/text_notes/heading_style.js index cfe22b0a6..5f5a7da28 100644 --- a/src/public/app/widgets/type_widgets/options/text_notes/heading_style.js +++ b/src/public/app/widgets/type_widgets/options/text_notes/heading_style.js @@ -1,13 +1,14 @@ import OptionsWidget from "../options_widget.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Heading Style

+

${t("heading_style.title")}

`; diff --git a/src/public/app/widgets/type_widgets/options/text_notes/highlights_list.js b/src/public/app/widgets/type_widgets/options/text_notes/highlights_list.js index 90a931ea6..7166e4023 100644 --- a/src/public/app/widgets/type_widgets/options/text_notes/highlights_list.js +++ b/src/public/app/widgets/type_widgets/options/text_notes/highlights_list.js @@ -1,25 +1,26 @@ import OptionsWidget from "../options_widget.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Highlights List

+

${t("highlights_list.title")}

-

You can customize the highlights list displayed in the right panel:

+

${t("highlights_list.description")}

- - - - - + + + + +

-
Highlights List visibility
+
${t("highlights_list.visibility_title")}
-

You can hide the highlights widget per-note by adding a #hideHighlightWidget label.

+

${t("highlights_list.visibility_description")}

-

You can configure a keyboard shortcut for quickly toggling the right pane (including Highlights) in the Options -> Shortcuts (name "toggleRightPane").

+

${t("highlights_list.shortcut_info")}

`; export default class HighlightsListOptions extends OptionsWidget { diff --git a/src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.js b/src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.js index 5715cb48f..6a73b7bea 100644 --- a/src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.js +++ b/src/public/app/widgets/type_widgets/options/text_notes/table_of_contents.js @@ -1,18 +1,19 @@ import OptionsWidget from "../options_widget.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Table of Contents

+

${t("table_of_contents.title")}

- Table of contents will appear in text notes when the note has more than a defined number of headings. You can customize this number: + ${t("table_of_contents.description")}
-

You can also use this option to effectively disable TOC by setting a very high number.

+

${t("table_of_contents.disable_info")}

-

You can configure a keyboard shortcut for quickly toggling the right pane (including TOC) in the Options -> Shortcuts (name "toggleRightPane").

+

${t("table_of_contents.shortcut_info")}

`; export default class TableOfContentsOptions extends OptionsWidget { diff --git a/src/public/app/widgets/type_widgets/options/text_notes/text_auto_read_only_size.js b/src/public/app/widgets/type_widgets/options/text_notes/text_auto_read_only_size.js index 28be14b8d..5b858df13 100644 --- a/src/public/app/widgets/type_widgets/options/text_notes/text_auto_read_only_size.js +++ b/src/public/app/widgets/type_widgets/options/text_notes/text_auto_read_only_size.js @@ -1,13 +1,14 @@ import OptionsWidget from "../options_widget.js"; +import { t } from "../../../../services/i18n.js"; const TPL = `
-

Automatic Read-Only Size

+

${t("text_auto_read_only_size.title")}

-

Automatic read-only note size is the size after which notes will be displayed in a read-only mode (for performance reasons).

+

${t("text_auto_read_only_size.description")}

- +
`; diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.json index e06342b19..8893b962a 100644 --- a/src/public/translations/cn/translation.json +++ b/src/public/translations/cn/translation.json @@ -1085,5 +1085,34 @@ "tray": { "title": "托盘", "enable_tray": "启用托盘图标(需要重启生效)" + }, + "heading_style": { + "title": "标题风格", + "plain": "纯文本", + "underline": "下划线", + "markdown": "Markdown风格" + }, + "highlights_list": { + "title": "高亮列表", + "description": "您可以自定义右侧面板中显示的高亮列表:", + "bold": "粗体字", + "italic": "斜体字", + "underline": "下划线字体", + "color": "彩色字体", + "bg_color": "带背景色的字体", + "visibility_title": "高亮列表可见性", + "visibility_description": "您可以通过添加 #hideHighlightWidget 标签来隐藏每个笔记的高亮小部件。", + "shortcut_info": "您可以在选项 -> 快捷键中为快速切换右侧面板(包括高亮列表)配置键盘快捷键(名称为 'toggleRightPane')。" + }, + "table_of_contents": { + "title": "目录", + "description": "当笔记中有超过一定数量的标题时,显示目录。您可以自定义此数量:", + "disable_info": "您可以设置一个非常大的数来禁用目录。", + "shortcut_info": "您可以在 “选项” -> “快捷键” 中配置一个键盘快捷键,以便快速切换右侧面板(包括目录)(名称为 'toggleRightPane')。" + }, + "text_auto_read_only_size": { + "title": "自动只读大小", + "description": "自动只读笔记大小是超过该大小后,笔记将以只读模式显示(出于性能考虑)。", + "label": "自动只读大小(文本笔记)" } } diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.json index f530302a7..ec7d7f662 100644 --- a/src/public/translations/en/translation.json +++ b/src/public/translations/en/translation.json @@ -1086,5 +1086,34 @@ "tray": { "title": "Tray", "enable_tray": "Enable tray (Trilium needs to be restarted for this change to take effect)" + }, + "heading_style": { + "title": "Heading Style", + "plain": "Plain", + "underline": "Underline", + "markdown": "Markdown-style" + }, + "highlights_list": { + "title": "Highlights List", + "description": "You can customize the highlights list displayed in the right panel:", + "bold": "Bold font", + "italic": "Italic font", + "underline": "Underlined font", + "color": "Font with color", + "bg_color": "Font with background color", + "visibility_title": "Highlights List visibility", + "visibility_description": "You can hide the highlights widget per-note by adding a #hideHighlightWidget label.", + "shortcut_info": "You can configure a keyboard shortcut for quickly toggling the right pane (including Highlights) in the Options -> Shortcuts (name 'toggleRightPane')." + }, + "table_of_contents": { + "title": "Table of Contents", + "description": "Table of contents will appear in text notes when the note has more than a defined number of headings. You can customize this number:", + "disable_info": "You can also use this option to effectively disable TOC by setting a very high number.", + "shortcut_info": "You can configure a keyboard shortcut for quickly toggling the right pane (including TOC) in the Options -> Shortcuts (name 'toggleRightPane')." + }, + "text_auto_read_only_size": { + "title": "Automatic Read-Only Size", + "description": "Automatic read-only note size is the size after which notes will be displayed in a read-only mode (for performance reasons).", + "label": "Automatic read-only size (text notes)" } }