This include file provides high-level multi-lingual support via Slices. Its
purpose is to define the slices LANG_XX according to the multi-lingual
The general intend of this slice-based approach is to use the defined slices
in Pass 9 (Slice) via WMLs -o option. A typical shebang-line example for
the use with a webservers content negotiation feature is:
#!wml -o (ALL-LANG_*)+LANG_EN:index.html.en \
Since WML 1.7.0, the <lang:star:slice:> tag is an alternative
to this shebang-line.
Before you can use a language, you have to define the corresponding tags via
<lang:new>. For instance when you want to use the languages english
and german, use:
Then the following tags are defined:
i.e. for both languages a container tag and a simple tag is defined. The
container tag is more readable while the simple tag is nicer for short
variants. When the names lang:xx are still to large for you, you
can use the short attribute to <lang:new>
<lang:new id=en short>
<lang:new id=de short>
when then leads to the defintion of the shortcut variants:
Additionally you always have the
<lang:area>...</lang:area> container tag available which
provides an alternative way of selecting the language in its body. It
automatically surrounds the data between (xx) start tags with the
corresponding LANG_XX slice.
The following are equal:
<lang:xx: Foo><lang:yy Bar>
Because these three lines internally get expanded to
There is one additional special tag: <lang:star:>. This tag
expands its attribute line like the <lang:xx:> tags but multiple
times. Actually as much as defined languages exists (<lang:new>!).
And in each expansion the asterisks (=stars) in the data gets replaced by the
Is is sometimes convenient to use another wildcard, e.g. when defining
navigation bars. The <lang:set-wildcard> tag does the job.
The attribute becomes the wildcard used in future substitutions. Without
attribute, the default value is restored. You may specify any regular
expression, and do not forget to escape special characters (the
astersisk is in fact \\*).
There is a more specialized variant named <lang:star:href:>
which is similar to <lang:star:> but treats its attribute value as
a URL part and tries to check if it already exists. If it doesnt exist the
tag expands the value without the star or an alternative value which can be
appended with |alt-value.
The <lang:star:slice:> is another variant to help writing
multi-lingual files quickly. It must come after all occurences of
The %BASE form is recognized (see wml(1)) and an empty argument is
equivalent to the string %BASE.*.html. But note that the use of
this tag instead of the WML shebang line prevents WMk from doing its
job, because WMk can not guess output filenames in this case.
For complex multi-lingual documents, you may want to know in which
language text is currently processed. This is achieved with
which always returns current language (as defined in
<lang:new> or an empty string when outside of any language
portion. The macro
prints the newline separated list of defined languages.