.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "tmp::EonJLR0Y0Q::Hoola 3" .TH tmp::EonJLR0Y0Q::Hoola 3 "2018-12-25" "EN Tools" "EN Tools" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" wml::std::lang \- Multi\-Lingual Support .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& #use wml::std::lang \& \& \& \& \& (xx) ... (yy) ... \& \& \& \& \& \& \& \& \& ... \& \& \& ... \& \& \& \& .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" This include file provides high-level multi-lingual support via Slices. Its purpose is to define the slices ``\f(CW\*(C`LANG_XX\*(C'\fR'' according to the multi-lingual selection tags. .PP The general intend of this slice-based approach is to use the defined slices in Pass 9 (Slice) via WMLs \fB\-o\fR option. A typical shebang-line example for the use with a webserver's content negotiation feature is: .PP .Vb 2 \& #!wml \-o (ALL\-LANG_*)+LANG_EN:index.html.en \e \& \-o (ALL\-LANG_*)+LANG_DE:index.html.de .Ve .PP Since \s-1WML 1.7.0,\s0 the \f(CW\*(C`\*(C'\fR tag is an alternative to this shebang-line. .PP Before you can use a language, you have to define the corresponding tags via \&\f(CW\*(C`\*(C'\fR. For instance when you want to use the languages english and german, use: .PP .Vb 2 \& \& .Ve .PP Then the following tags are defined: .PP .Vb 4 \& ... \& ... \& \& .Ve .PP 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 \f(CW\*(C`lang:xx\*(C'\fR are still to large for you, you can use the \f(CW\*(C`short\*(C'\fR attribute to \f(CW\*(C`\*(C'\fR .PP .Vb 2 \& \& .Ve .PP when then leads to the definition of the shortcut variants: .PP .Vb 4 \& ... \& ... \& \& .Ve .PP Additionally you always have the \&\f(CW\*(C`\*(C'\fR...\f(CW\*(C`\*(C'\fR container tag available which provides an alternative way of selecting the language in its body. It automatically surrounds the data between `\f(CW\*(C`(xx)\*(C'\fR' start tags with the corresponding \f(CW\*(C`LANG_XX\*(C'\fR slice. .PP The following are equal: .PP .Vb 3 \& \& FooBar \& (xx)Foo(yy)Bar .Ve .PP Because these three lines internally get expanded to .PP .Vb 3 \& [LANG_XX:Foo:][LANG_YY:Bar:] \& [LANG_XX:Foo:][LANG_YY:Bar:] \& [LANG_XX:Foo:][LANG_YY:Bar:] .Ve .PP There is one additional special tag: \f(CW\*(C`\*(C'\fR. This tag expands its attribute line like the \f(CW\*(C`\*(C'\fR tags but multiple times. Actually as much as defined languages exists (\f(CW\*(C`\*(C'\fR!). And in each expansion the asterisks (=stars) in the data gets replaced by the language identifier. .PP Is is sometimes convenient to use another wildcard, e.g. when defining navigation bars. The \f(CW\*(C`\*(C'\fR 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 ``\e\e*''). .PP .Vb 3 \& \& \& .Ve .PP There is a more specialized variant named \f(CW\*(C`\*(C'\fR which is similar to \f(CW\*(C`\*(C'\fR but treats its attribute value as a \s-1URL\s0 part and tries to check if it already exists. If it doesn't exist the tag expands the value without the star or an alternative value which can be appended with ``|alt\-value''. .PP The \f(CW\*(C`\*(C'\fR is another variant to help writing multi-lingual files quickly. It must come after all occurrences of \&\f(CW\*(C`\*(C'\fR tags. .PP .Vb 1 \& .Ve .PP The `\f(CW%BASE\fR' form is recognized (see \fBwml\fR\|(1)) and an empty argument is equivalent to the string `\f(CW\*(C`%BASE.*.html\*(C'\fR'. But note that the use of this tag instead of the \s-1WML\s0 shebang line prevents WMk from doing its job, because WMk can not guess output filenames in this case. .PP For complex multi-lingual documents, you may want to know in which language text is currently processed. This is achieved with .PP .Vb 1 \& .Ve .PP which always returns current language (as defined in \&\f(CW\*(C`\*(C'\fR or an empty string when outside of any language portion. The macro .PP .Vb 1 \& .Ve .PP prints the newline separated list of defined languages. .SH "EXAMPLE" .IX Header "EXAMPLE" The following is an example of a webpage \f(CW\*(C`index.wml\*(C'\fR with a multi-lingual header and hyperlink: .PP .Vb 2 \& #use wml::std::lang \& #use wml::std::href \& \& \& \& \& \&

\& \& \& .Ve .PP When processed via .PP .Vb 1 \& $ wml index.wml .Ve .PP The following two output files are generated (assuming that \fIindex2.html\fR and only \fIindex2.de.html\fR exists): .PP index.html.en: .PP .Vb 3 \&

Welcome

\& The Hyperlink \& The Hyperlink .Ve .PP index.html.de: .PP .Vb 3 \&

Willkommen

\& The Hyperlink \& The Hyperlink .Ve .SH "AUTHOR" .IX Header "AUTHOR" .Vb 3 \& Ralf S. Engelschall \& rse@engelschall.com \& www.engelschall.com \& \& Denis Barbier \& barbier@engelschall.com .Ve .SH "REQUIRES" .IX Header "REQUIRES" .Vb 2 \& Internal: P1, P2, P6, P9 \& External: \-\- .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBslice\fR\|(1)