Feat: translatable plugins and docs (#7821)

* feat: t macro and docs

* feat: support block mode so you can transclude whole tiddler

* refactor: use lingo and procedure

* refactor: use function instead of set variable

* docs: about  mode:"inline"

* Update LingoMacro.tid

* docs: more usage about inline

* refactor: update translate macro to reuse lingo macro

* Delete translateMacro.tid

* refactor: update translation of tiddlyweb

* docs: more tiddlyweb l10n

* feat: add comment, so when use <$text text=<<lingo>> by mistake, it shows

* i18n: add more l10n

* feat: add tree to plugin to reveal l10n structure

* i18n: add menubar translation for example

* i18n: more for menubal

* docs: Headings -> Heading

* refactor: remove the "tree" tid

* Revert "refactor: remove the "tree" tid"

This reverts commit fb70f0b146.
This commit is contained in:
lin onetwo
2024-06-08 08:58:21 -05:00
committed by GitHub
parent 3ddd10d373
commit 78ace99685
37 changed files with 400 additions and 94 deletions

View File

@@ -1,16 +1,7 @@
title: GettingStarted
tags: $:/tags/GettingStarted
caption: Step 1<br>Syncing
caption: <<lingo GettingStartedStep1 "$:/plugins/tiddlywiki/tiddlyweb/language/">>
Welcome to ~TiddlyWiki and the ~TiddlyWiki community
\define lingo-base() $:/plugins/tiddlywiki/tiddlyweb/language/
Visit https://tiddlywiki.com/ to find out more about ~TiddlyWiki and what it can do.
! Syncing Changes to the Server
Before you can start storing important information in ~TiddlyWiki it is important to make sure that your changes are being reliably saved by the server.
# Create a new tiddler using the {{$:/core/images/new-button}} button in the sidebar on the right
# Click the {{$:/core/images/done-button}} button at the top right of the new tiddler
# Check the ~TiddlyWiki command line for a message confirming the tiddler has been saved
# Refresh the page in the browser to and verify that the new tiddler has been correctly saved
<<lingo GettingStarted>>

View File

@@ -4,4 +4,6 @@ url: https://tiddlywiki.com/library/v5.1.23/index.html
caption: {{$:/language/OfficialPluginLibrary}}
enabled: no
The official plugin library is disabled when using the client-server configuration. Instead, plugins should be installed via the `tiddlywiki.info` file, as described [[here|https://tiddlywiki.com/#Installing%20a%20plugin%20from%20the%20plugin%20library]].
\define lingo-base() $:/plugins/tiddlywiki/tiddlyweb/language/
<<lingo ConfigOfficialPluginLibrary>>

View File

@@ -0,0 +1,14 @@
title: $:/plugins/tiddlywiki/tiddlyweb/language/en-GB/GettingStarted
Welcome to ~TiddlyWiki and the ~TiddlyWiki community
Visit https://tiddlywiki.com/ to find out more about ~TiddlyWiki and what it can do.
! Syncing Changes to the Server
Before you can start storing important information in ~TiddlyWiki it is important to make sure that your changes are being reliably saved by the server.
# Create a new tiddler using the {{$:/core/images/new-button}} button in the sidebar on the right
# Click the {{$:/core/images/done-button}} button at the top right of the new tiddler
# Check the ~TiddlyWiki command line for a message confirming the tiddler has been saved
# Refresh the page in the browser to and verify that the new tiddler has been correctly saved

View File

@@ -0,0 +1,12 @@
title: $:/plugins/tiddlywiki/tiddlyweb/language/en-GB/
ConfigOfficialPluginLibrary: The official plugin library is disabled when using the client-server configuration. Instead, plugins should be installed via the `tiddlywiki.info` file, as described [[here|https://tiddlywiki.com/#Installing%20a%20plugin%20from%20the%20plugin%20library]].
GettingStartedStep1: Step 1<br>Syncing
CopySyncerLogs: Copy syncer logs to clipboard
LoginAs: You are logged in<$reveal state="$:/status/UserName" type="nomatch" text="" default=""> as <strong><$text text={{$:/status/UserName}}/></strong></$reveal>
Readonly: <$reveal state="$:/status/IsReadOnly" type="match" text="yes" default="no"> (read-only)</$reveal>
Login: Login
Logout: Logout
SaveSnapshot: Save snapshot for offline use
Refresh/Label: Refresh from server
Refresh/Button: Get latest changes from the server

View File

@@ -0,0 +1,7 @@
title: $:/plugins/tiddlywiki/tiddlyweb/language/en-GB/readme
This plugin runs in the browser to synchronise tiddler changes to and from a TiddlyWeb-compatible server (including TiddlyWiki 5 itself, running on Node.js). It is inert when run under Node.js. Disabling this plugin via the browser can not be undone via the browser since this plugin provides the mechanism to synchronize settings with the server.
Changes made while offline are saved in memory and automatically synchonised with the server when the connection is re-established. However, if the browser tab is closed or another URL is loaded, the in-memory changes will be lost. The [[https://tiddlywiki.com/#BrowserStorage Plugin]] may be added to provide temporary filesystem storage of tiddler changes made while offline and enable them to be synchronised with the server the next time the wiki is loaded in the same browser.
[[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/tiddlyweb]]

View File

@@ -0,0 +1,14 @@
title: $:/plugins/tiddlywiki/tiddlyweb/language/zh-Hans/GettingStarted
欢迎来到太微和太微社区
访问 https://tiddlywiki.com/ 了解太微的细节和了解它能做什么。
! 同步更改到服务器
在你开始在太微中存储重要信息之前,确保你的修改被服务器可靠地保存是非常重要的。
# 使用右侧边栏的 {{$:/core/images/new-button}} 按钮创建一个新条目
# 点击新条目右上方的 {{$:/core/images/done-button}} 按钮
# 检查太微命令行是否有确认条目已保存的信息
# 刷新浏览器页面,确认新条目已正确保存

View File

@@ -0,0 +1,12 @@
title: $:/plugins/tiddlywiki/tiddlyweb/language/zh-Hans/
ConfigOfficialPluginLibrary: 使用客户端-服务器配置时,官方插件库将被禁用。取而代之的是,应按照[[here|https://tiddlywiki.com/#Installing%20a%20plugin%20from%20the%20plugin%20library]]所述,通过 "tiddlywiki.info" 文件安装插件。
GettingStartedStep1: 第一步<br>同步
CopySyncerLogs: 将同步器日志复制到剪贴板
LoginAs: 您目前已登录<$reveal state="$:/status/UserName" type="nomatch" text="" default="">为<strong><$text text={{$:/status/UserName}}/></strong></$reveal>
Readonly: <$reveal state="$:/status/IsReadOnly" type="match" text="yes" default="no">(只读)</$reveal>
Login: 登录
Logout: 登出
SaveSnapshot: 保存快照以供离线使用
Refresh/Label: 从服务器刷新
Refresh/Button: 从服务器获取最新变更

View File

@@ -0,0 +1,7 @@
title: $:/plugins/tiddlywiki/tiddlyweb/language/zh-Hans/readme
该插件在浏览器中运行,用于双向同步更改的条目到与 TiddlyWeb 兼容的服务器上(包括在 Node.js 上运行的 TiddlyWiki 5 本身)。在 Node.js 上运行时,它是无法自救的:由于就是该插件提供了与服务器同步设置和插件的机制,因此通过浏览器禁用该插件后,是无法撤销对自己的禁用的。
离线时所作的更改会保存在内存中,并在重新建立连接时自动与服务器同步。不过,如果关闭浏览器标签页或加载另一个 URL内存中的更改就会丢失。可以添加[[https://tiddlywiki.com/#BrowserStorage Plugin]],为离线时的条目更改提供临时文件系统存储,并使其在下次在同一浏览器中加载知识库时与服务器同步。
[[源代码|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/tiddlyweb]]

View File

@@ -1,7 +1,5 @@
title: $:/plugins/tiddlywiki/tiddlyweb/readme
This plugin runs in the browser to synchronise tiddler changes to and from a TiddlyWeb-compatible server (including TiddlyWiki 5 itself, running on Node.js). It is inert when run under Node.js. Disabling this plugin via the browser can not be undone via the browser since this plugin provides the mechanism to synchronize settings with the server.
\define lingo-base() $:/plugins/tiddlywiki/tiddlyweb/language/
Changes made while offline are saved in memory and automatically synchonised with the server when the connection is re-established. However, if the browser tab is closed or another URL is loaded, the in-memory changes will be lost. The [[https://tiddlywiki.com/#BrowserStorage Plugin]] may be added to provide temporary filesystem storage of tiddler changes made while offline and enable them to be synchronised with the server the next time the wiki is loaded in the same browser.
[[Source code|https://github.com/Jermolene/TiddlyWiki5/blob/master/plugins/tiddlywiki/tiddlyweb]]
<<lingo readme>>

View File

@@ -1,6 +1,8 @@
title: $:/plugins/tiddlywiki/tiddlyweb/syncer-actions/copy-logs
tags: $:/tags/SyncerDropdown
\define lingo-base() $:/plugins/tiddlywiki/tiddlyweb/language/
<$button message="tm-copy-syncer-logs-to-clipboard" class="tc-btn-invisible">
{{$:/core/images/copy-clipboard}} Copy syncer logs to clipboard
{{$:/core/images/copy-clipboard}} <<lingo CopySyncerLogs>>
</$button>

View File

@@ -1,9 +1,11 @@
title: $:/plugins/tiddlywiki/tiddlyweb/syncer-actions/login-status
tags: $:/tags/SyncerDropdown
\define lingo-base() $:/plugins/tiddlywiki/tiddlyweb/language/
<$reveal state="$:/status/IsLoggedIn" type="match" text="yes">
<div class="tc-drop-down-info">
You are logged in<$reveal state="$:/status/UserName" type="nomatch" text="" default=""> as <strong><$text text={{$:/status/UserName}}/></strong></$reveal><$reveal state="$:/status/IsReadOnly" type="match" text="yes" default="no"> (read-only)</$reveal>
<<lingo LoginAs>><<lingo Readonly>>
</div>
<hr/>
</$reveal>

View File

@@ -1,8 +1,10 @@
title: $:/plugins/tiddlywiki/tiddlyweb/syncer-actions/login
tags: $:/tags/SyncerDropdown
\define lingo-base() $:/plugins/tiddlywiki/tiddlyweb/language/
<$reveal state="$:/status/IsLoggedIn" type="nomatch" text="yes">
<$button message="tm-login" class="tc-btn-invisible">
{{$:/core/images/unlocked-padlock}} Login
{{$:/core/images/unlocked-padlock}} <<lingo Login>>
</$button>
</$reveal>

View File

@@ -1,8 +1,10 @@
title: $:/plugins/tiddlywiki/tiddlyweb/syncer-actions/logout
tags: $:/tags/SyncerDropdown
\define lingo-base() $:/plugins/tiddlywiki/tiddlyweb/language/
<$reveal state="$:/status/IsLoggedIn" type="match" text="yes">
<$button message="tm-logout" class="tc-btn-invisible">
{{$:/core/images/cancel-button}} Logout
{{$:/core/images/cancel-button}} <<lingo Logout>>
</$button>
</$reveal>

View File

@@ -1,9 +1,17 @@
title: $:/plugins/tiddlywiki/tiddlyweb/syncer-actions/refresh
tags: $:/tags/SyncerDropdown
<$reveal state="$:/status/IsLoggedIn" type="match" text="yes">
<$button tooltip="Get latest changes from the server" aria-label="Refresh from server" class="tc-btn-invisible">
<$action-sendmessage $message="tm-server-refresh"/>
{{$:/core/images/refresh-button}}<span class="tc-btn-text"><$text text="Get latest changes from the server"/></span>
</$button>
</$reveal>
\whitespace trim
<$let lingo-base="$:/plugins/tiddlywiki/tiddlyweb/language/">
<$wikify name=buttonText text="<<lingo Refresh/Button>>">
<$wikify name=ariaLabel text="<<lingo Refresh/Label>>">
<$reveal state="$:/status/IsLoggedIn" type="match" text="yes">
<$button tooltip=<<ariaLabel>> aria-label=<<ariaLabel>> class="tc-btn-invisible">
<$action-sendmessage $message="tm-server-refresh"/>
{{$:/core/images/refresh-button}}
<span class="tc-btn-text"><<buttonText>></span>
</$button>
</$reveal>
</$wikify>
</$wikify>
</$let>

View File

@@ -1,9 +1,11 @@
title: $:/plugins/tiddlywiki/tiddlyweb/syncer-actions/save-snapshot
tags: $:/tags/SyncerDropdown
\define lingo-base() $:/plugins/tiddlywiki/tiddlyweb/language/
<$button class="tc-btn-invisible">
<$wikify name="site-title" text={{$:/config/SaveWikiButton/Filename}}>
<$action-sendmessage $message="tm-download-file" $param={{$:/config/SaveWikiButton/Template}} filename=<<site-title>>/>
</$wikify>
{{$:/core/images/download-button}} Save snapshot for offline use
{{$:/core/images/download-button}} <<lingo SaveSnapshot>>
</$button>

View File

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