1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-02 14:29:55 +00:00

i18n: add menubar translation for example

This commit is contained in:
linonetwo 2024-02-06 22:07:58 +08:00
parent 33456a5fae
commit 8840a57b41
9 changed files with 102 additions and 37 deletions

View File

@ -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:

View File

@ -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
! <<lingo Config/Heading1>>
!! Menu Items
!! <<lingo Config/MenuItems/Headings>>
Select which menu items will be shown. You can also drag items to reorder them.
<<lingo Config/MenuItems/Description>>
<$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.
</$set>
!! Breakpoint Position
!! <<lingo Config/BreakpointPosition/Headings>>
The breakpoint position between narrow and wide screens. Should include CSS units (eg. `400px`).
<<lingo Config/BreakpointPosition/Description>>
<$edit-text tiddler="$:/config/plugins/menubar/breakpoint" default="" tag="input"/>
!! Contents Tag
!! <<lingo Config/ContentsTag/Headings>>
The tag for the ~TableOfContents used in the Contents dropdown
<<lingo Config/ContentsTag/Description>>
<$edit-text tiddler="$:/config/plugins/menubar/TableOfContents/Tag" default="" tag="input"/>
!! Menu Bar Colours
!! <<lingo Config/MenuBarColours/Headings>>
To change the colour of the menu bar, define the colours `menubar-foreground` and `menubar-background` in the currently selected palette
<<lingo Config/MenuBarColours/Description>>

View File

@ -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

View File

@ -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 <<tag $:/tags/MenuBar>>. 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;`.

View File

@ -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`。

View File

@ -0,0 +1,30 @@
title: $:/plugins/tiddlywiki/menubar/language/zh-Hans/readme
!! 简介
该插件提供的菜单栏具有以下功能:
* 菜单项的形式可以是简单的文本链接、下拉菜单或完全自定义的内容
* 可通过控制面板单独启用菜单项
* 通过将菜单项缩减为抽屉式导航(也叫"汉堡包"下拉菜单)来应对屏幕宽度减小的情况
!! 菜单项标记
菜单项被标记为 <<tag $:/tags/MenuBar>>。本插件使用以下字段:
|!字段名称 |!用途 |
|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;` 而推到菜单栏的右侧。

View File

@ -2,5 +2,5 @@
"title": "$:/plugins/tiddlywiki/menubar",
"name": "Menu Bar",
"description": "Menu Bar",
"list": "readme config"
"list": "readme config tree"
}

View File

@ -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 <<tag $:/tags/MenuBar>>. 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;`.
<<lingo readme>>

View File

@ -0,0 +1,4 @@
title: $:/plugins/tiddlywiki/menubar/tree
type: text/vnd.tiddlywiki
<<tree prefix:"$:/plugins/tiddlywiki/menubar/">>