-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TODO: remove after TiddlyWiki/TiddlyWiki5#7821 is merged
- Loading branch information
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
title: $:/core/macros/lingo | ||
tags: $:/tags/Global | ||
|
||
<!-- //TODO: remove after https://github.com/Jermolene/TiddlyWiki5/pull/7821 is merged --> | ||
<!-- Note that lingo-base should end with a trailing slash character --> | ||
\procedure lingo-base() | ||
$:/language/ | ||
\end lingo-base | ||
|
||
\procedure lingo(title,override-lingo-base) | ||
<!-- Lingo procedure --> | ||
<!-- Get the parse mode used to invoke this procedure --> | ||
<$parameters $parseMode="parseMode"> | ||
<!-- Compute the lingo-base--> | ||
<$let active-lingo-base={{{ [<override-lingo-base>!match[]else<lingo-base>] }}}> | ||
<!-- First try the old school <active-lingo-base><title> format --> | ||
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix<title>] }}} $mode=<<parseMode>>> | ||
<!-- If that didn't work, try the new <lingo-base><langcode>/<title> format --> | ||
<$let language-code={{{ [[$:/language]get[text]get[name]else[en-GB]] }}}> | ||
<$transclude $tiddler={{{ [<active-lingo-base>addsuffix<language-code>addsuffix[/]addsuffix<title>] }}} $mode=<<parseMode>>/> | ||
</$let> | ||
</$transclude> | ||
</$let> | ||
</$parameters> | ||
\end lingo |