1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-10 03:49:56 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/macros/LingoMacro.tid

38 lines
1.4 KiB
Plaintext
Raw Normal View History

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)}}