1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-10 11:59:58 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/macros/LingoMacro.tid
lin onetwo 78ace99685
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.
2024-06-08 14:58:21 +01:00

38 lines
1.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

caption: lingo
created: 20150221154907000
modified: 20231028123405895
tags: Macros [[Core Macros]]
title: lingo Macro
type: text/vnd.tiddlywiki
The <<.def lingo>> [[macro|Macros]] relates to the translation of ~TiddlyWiki's user interface into other languages. It returns a piece of text in the user's currently selected language.
Translatable text is supplied by
# Language plugins
# Any l10n (localization) strings outside of the language plugins
!! Language plugins
You can directly pass title to `lingo` macro, when there is a language plugin containing a tiddler with such title that start with `$:/language/`.
;title
: The title of the shadow tiddler that contains the text. The prefix `$:/language/` is added automatically
<<.macro-examples "lingo (for language plugin)">>
!! Any l10n strings
To translate any text that directly placed in user's wiki, instead of in a language plugin, you can set the `lingo-base` variable to teach <<.def lingo>> macro the place to look for.
!!! Parameters
;key
: The last part of title of the tiddler that contains the text. The `<<lingo-base>>` prefix and current language name prefix is added automatically
;lingo-base-fallback
: Optional lingo-base when it is not possible to define `lingo-base` variable (for example, when using this macro in the caption field), you can set the lingo base by passing this parameter
<<.macro-examples "lingo (for custom base)">>
{{lingo Macro (file structure)}}