2014-06-12 17:01:33 +00:00
|
|
|
title: $:/core/macros/lingo
|
2024-06-08 13:58:21 +00:00
|
|
|
tags: $:/tags/Global
|
2014-06-12 17:01:33 +00:00
|
|
|
|
2024-06-08 13:58:21 +00:00
|
|
|
<!-- Note that lingo-base should end with a trailing slash character -->
|
|
|
|
\procedure lingo-base()
|
2014-06-14 17:06:56 +00:00
|
|
|
$:/language/
|
2024-06-08 13:58:21 +00:00
|
|
|
\end lingo-base
|
2014-06-12 17:01:33 +00:00
|
|
|
|
2024-06-08 13:58:21 +00:00
|
|
|
\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
|