diff --git a/editions/tw5.com/tiddlers/macros/examples/lingo Macro (file structure).tid b/editions/tw5.com/tiddlers/macros/examples/lingo Macro (file structure).tid index f691ccd08..e653f234b 100644 --- a/editions/tw5.com/tiddlers/macros/examples/lingo Macro (file structure).tid +++ b/editions/tw5.com/tiddlers/macros/examples/lingo Macro (file structure).tid @@ -21,6 +21,8 @@ When developing a plugin, you may want to organize your language files like this └── plugin.info ``` +See [[$:/plugins/tiddlywiki/menubar/tree]] for an example. + !!! Define Multiple Translations in One Tiddler And the content of `language/en-GB/Translations.multids` may looks like this: diff --git a/plugins/tiddlywiki/menubar/config.tid b/plugins/tiddlywiki/menubar/config.tid index abcb8fcea..edc0e43c9 100644 --- a/plugins/tiddlywiki/menubar/config.tid +++ b/plugins/tiddlywiki/menubar/config.tid @@ -3,12 +3,13 @@ tags: $:/tags/ControlPanel/Toolbars caption: Menu Bar \define config-base() $:/config/plugins/menubar/MenuItems/Visibility/ +\define lingo-base() $:/plugins/tiddlywiki/menubar/language/ -! Menu Bar Configuration +! <> -!! Menu Items +!! <> -Select which menu items will be shown. You can also drag items to reorder them. +<> <$set name="tv-config-toolbar-icons" value="yes"> @@ -20,18 +21,18 @@ Select which menu items will be shown. You can also drag items to reorder them. -!! Breakpoint Position +!! <> -The breakpoint position between narrow and wide screens. Should include CSS units (eg. `400px`). +<> <$edit-text tiddler="$:/config/plugins/menubar/breakpoint" default="" tag="input"/> -!! Contents Tag +!! <> -The tag for the ~TableOfContents used in the Contents dropdown +<> <$edit-text tiddler="$:/config/plugins/menubar/TableOfContents/Tag" default="" tag="input"/> -!! Menu Bar Colours +!! <> -To change the colour of the menu bar, define the colours `menubar-foreground` and `menubar-background` in the currently selected palette +<> diff --git a/plugins/tiddlywiki/menubar/language/en-GB/Translations.multids b/plugins/tiddlywiki/menubar/language/en-GB/Translations.multids new file mode 100644 index 000000000..c0f1a0be9 --- /dev/null +++ b/plugins/tiddlywiki/menubar/language/en-GB/Translations.multids @@ -0,0 +1,12 @@ +title: $:/plugins/tiddlywiki/menubar/language/en-GB/ + +Config/Heading1: Menu Bar Configuration +Config/MenuItems/Headings: Menu Items +Config/MenuItems/Description: Select which menu items will be shown. You can also drag items to reorder them. +Config/BreakpointPosition/Headings: Breakpoint Position +Config/BreakpointPosition/Description: The breakpoint position between narrow and wide screens. Should include CSS units (eg. `400px`). +Config/ContentsTag/Headings: Contents Tag +Config/ContentsTag/Description: The tag for the ~TableOfContents used in the Contents dropdown +Config/MenuBarColours/Headings: Menu Bar Colours +Config/MenuBarColours/Description: To change the colour of the menu bar, define the colours `menubar-foreground` and `menubar-background` in the currently selected palette + diff --git a/plugins/tiddlywiki/menubar/language/en-GB/readme.tid b/plugins/tiddlywiki/menubar/language/en-GB/readme.tid new file mode 100644 index 000000000..0cbb781cd --- /dev/null +++ b/plugins/tiddlywiki/menubar/language/en-GB/readme.tid @@ -0,0 +1,30 @@ +title: $:/plugins/tiddlywiki/menubar/language/en-GB/readme + +!! Introduction + +This plugin provides a menu bar with the following features: + +* Menu items take the form of simple text links, dropdowns, or entirely custom content +* Menu items can be individually enabled via the control panel +* Responds to reduced screen width by abbreviating the menu items to a "hamburger" dropdown + +!! Menu Item Tiddlers + +Menu items are tagged <>. The following fields are used by this plugin: + +|!Field Name |!Purpose | +|title |Each menu item must have a unique title (not shown to the user) | +|description |Description for use in listings | +|tags |Must contain `$:/tags/MenuBar` | +|caption |The text that is displayed for the menu item. Avoid links, using `~` to suppress CamelCase links if required | +|target |For simple link menu items specifies a tiddler title as the target of the link | +|is-dropdown |Set to `yes` to indicate a dropdown menu item | +|dropdown-position |Optional position for the dropdown (can be ''left'', ''above'', ''aboveleft'', ''aboveright'', ''right'', ''belowleft'', ''belowright'' or ''below'') | +|text |For dropdown menu items, specifies the body of the dropdown | +|custom-menu-content |Optional wikitext to be displayed in place of the caption | +|custom-menu-styles-wide |Optional string of styles to be applied to menu item when the menubar is wide | +|custom-menu-styles-narrow |Optional string of styles to be applied to menu item when the menubar is narrow | + +Custom menu items should make sure that the clickable link or button is an immediate child, and not wrapped in another element. + +Note that menu items can be pushed to the right of the menu bar setting the ''custom-menu-styles'' field to `float: right;`. diff --git a/plugins/tiddlywiki/menubar/language/zh-Hans/Translations.multids b/plugins/tiddlywiki/menubar/language/zh-Hans/Translations.multids new file mode 100644 index 000000000..46f0d2aaa --- /dev/null +++ b/plugins/tiddlywiki/menubar/language/zh-Hans/Translations.multids @@ -0,0 +1,11 @@ +title: $:/plugins/tiddlywiki/menubar/language/zh-Hans/ + +Config/Heading1: 菜单栏配置 +Config/MenuItems/Headings: 菜单项 +Config/MenuItems/Description: 选择要显示的菜单项。您还可以通过拖动项目来重新排序。 +Config/BreakpointPosition/Headings: 响应式断点位置 +Config/BreakpointPosition/Description: 窄屏和宽屏之间的分界点位置。应包含 CSS 单位(如 `400px`)。 +Config/ContentsTag/Headings: 内容标签 +Config/ContentsTag/Description: 内容下拉菜单中使用的 TOC 目录标签 +Config/MenuBarColours/Headings: 菜单栏颜色 +Config/MenuBarColours/Description: 要更改菜单栏的颜色,请在当前选定的调色板中定义颜色 `menubar-foreground` 和 `menubar-background`。 \ No newline at end of file diff --git a/plugins/tiddlywiki/menubar/language/zh-Hans/readme.tid b/plugins/tiddlywiki/menubar/language/zh-Hans/readme.tid new file mode 100644 index 000000000..1f4a536ac --- /dev/null +++ b/plugins/tiddlywiki/menubar/language/zh-Hans/readme.tid @@ -0,0 +1,30 @@ +title: $:/plugins/tiddlywiki/menubar/language/zh-Hans/readme + +!! 简介 + +该插件提供的菜单栏具有以下功能: + +* 菜单项的形式可以是简单的文本链接、下拉菜单或完全自定义的内容 +* 可通过控制面板单独启用菜单项 +* 通过将菜单项缩减为抽屉式导航(也叫"汉堡包"下拉菜单)来应对屏幕宽度减小的情况 + +!! 菜单项标记 + +菜单项被标记为 <>。本插件使用以下字段: + +|!字段名称 |!用途 | +|title |每个菜单项必须有一个唯一的标题(不显示给用户)| +|description |在列表中使用的描述 | +|tags |必须包含 `$:/tags/MenuBar` | +|caption |菜单项显示的文本。避免使用链接,必要时使用 `~` 来抑制 CamelCase 链接 | +|target |对于简单链接菜单项,指定一个 tiddler 标题作为链接的目标 | +|is-dropdown |设置为 `yes` 表示下拉菜单项 | +|dropdown-position |下拉位置(可选 "左"、"上"、"左上" 等,需要使用英文 ''left'', ''above'', ''aboveleft'', ''aboveright'', ''right'', ''belowleft'', ''belowright'', ''below'') | +|text |对于下拉菜单项,指定下拉菜单的正文 | +|custom-menu-content |可选显示的维基文本,以代替标题 | +|custom-menu-styles-wide |当菜单栏是宽模式时,应用于菜单项的样式字符串选项 | +|custom-menu-styles-narrow |当菜单栏是窄模式时,应用于菜单项的样式的可选字符串 | + +自定义菜单项应确保可点击链接或按钮是直接子元素,而不是包裹在其他元素中。 + +请注意,菜单项可以通过将 ''custom-menu-styles'' 字段设置为 `float: right;` 而推到菜单栏的右侧。 diff --git a/plugins/tiddlywiki/menubar/plugin.info b/plugins/tiddlywiki/menubar/plugin.info index 4fa580198..5c9c0fa4a 100644 --- a/plugins/tiddlywiki/menubar/plugin.info +++ b/plugins/tiddlywiki/menubar/plugin.info @@ -2,5 +2,5 @@ "title": "$:/plugins/tiddlywiki/menubar", "name": "Menu Bar", "description": "Menu Bar", - "list": "readme config" + "list": "readme config tree" } diff --git a/plugins/tiddlywiki/menubar/readme.tid b/plugins/tiddlywiki/menubar/readme.tid index 4282654bd..c9b75abbe 100644 --- a/plugins/tiddlywiki/menubar/readme.tid +++ b/plugins/tiddlywiki/menubar/readme.tid @@ -1,30 +1,5 @@ title: $:/plugins/tiddlywiki/menubar/readme -!! Introduction +\define lingo-base() $:/plugins/tiddlywiki/menubar/language/ -This plugin provides a menu bar with the following features: - -* Menu items take the form of simple text links, dropdowns, or entirely custom content -* Menu items can be individually enabled via the control panel -* Responds to reduced screen width by abbreviating the menu items to a "hamburger" dropdown - -!! Menu Item Tiddlers - -Menu items are tagged <>. The following fields are used by this plugin: - -|!Field Name |!Purpose | -|title |Each menu item must have a unique title (not shown to the user) | -|description |Description for use in listings | -|tags |Must contain `$:/tags/MenuBar` | -|caption |The text that is displayed for the menu item. Avoid links, using `~` to suppress CamelCase links if required | -|target |For simple link menu items specifies a tiddler title as the target of the link | -|is-dropdown |Set to `yes` to indicate a dropdown menu item | -|dropdown-position |Optional position for the dropdown (can be ''left'', ''above'', ''aboveleft'', ''aboveright'', ''right'', ''belowleft'', ''belowright'' or ''below'') | -|text |For dropdown menu items, specifies the body of the dropdown | -|custom-menu-content |Optional wikitext to be displayed in place of the caption | -|custom-menu-styles-wide |Optional string of styles to be applied to menu item when the menubar is wide | -|custom-menu-styles-narrow |Optional string of styles to be applied to menu item when the menubar is narrow | - -Custom menu items should make sure that the clickable link or button is an immediate child, and not wrapped in another element. - -Note that menu items can be pushed to the right of the menu bar setting the ''custom-menu-styles'' field to `float: right;`. +<> diff --git a/plugins/tiddlywiki/menubar/tree.tid b/plugins/tiddlywiki/menubar/tree.tid new file mode 100644 index 000000000..f818ca78e --- /dev/null +++ b/plugins/tiddlywiki/menubar/tree.tid @@ -0,0 +1,4 @@ +title: $:/plugins/tiddlywiki/menubar/tree +type: text/vnd.tiddlywiki + +<> \ No newline at end of file