Difference between revisions of "Template:Test"

From PC-BSD Wiki
Jump to: navigation, search
m (Created page with "{{#ifeq:[[:Template:Text/{{#if:{{{2|}}}|{{{2}}}|{{uselang}}}}]]|{{text/{{#if:{{{2|}}}|{{{2}}}|{{uselang}}}}}}|{{#if:{{{3|}}}||{{text/en|{{{1|}}}}}}}|{{ifnotempty1|{{text/{{#if:{{...")
 
m (Replaced content with "|style="background:#{{{bg|ee}}}{{{bg|ee}}}{{{bg|ee}}}; text-align:{{{align|center}}}; border:solid #BABFA3; border-width:0px 1px 1px 0px; {{{2|"}}}|{{{1|}}}")
Line 1: Line 1:
{{#ifeq:[[:Template:Text/{{#if:{{{2|}}}|{{{2}}}|{{uselang}}}}]]|{{text/{{#if:{{{2|}}}|{{{2}}}|{{uselang}}}}}}|{{#if:{{{3|}}}||{{text/en|{{{1|}}}}}}}|{{ifnotempty1|{{text/{{#if:{{{2|}}}|{{{2}}}|{{uselang}}}}|{{{1|}}}}}|{{#if:{{{3|}}}||{{text/en|{{{1|}}}}}}}}}}}<noinclude>
+
|style="background:#{{{bg|ee}}}{{{bg|ee}}}{{{bg|ee}}}; text-align:{{{align|center}}}; border:solid #BABFA3; border-width:0px 1px 1px 0px; {{{2|"}}}|{{{1|}}}
This template produces certain text, given by the English version or a code, in a  given language. By default, the fall-back language is English. Optionally this is suppressed, and the template produces nothing if the text is not available in the desired language. This can be useful if the English version is given anyway, with another call of the template.
+
 
+
{{tdoc
+
|1=1
+
|1d=code for the text to be produced
+
|1def=
+
|2=2
+
|2d=language code for the language in which the text is expressed
+
|2def=the result of {{xpsoc|uselang|gives=, giving}}
+
|3=3
+
|3d=if non-empty: do ''not'' produce the English word if the word in the requested language is not available; instead, produce nothing
+
|3def=
+
|name=Text
+
|i18n-method=autotranslate
+
|i18n-desc=
+
|relieson=
+
*The page <code>MediaWiki:Lang/</code>''xx'' for the user language ''xx'' set in the preferences; it should contain the language code ''xx'' {{Special:PrefixIndex/mediawiki:Lang/}}
+
*<code>Template:Text/</code>''xx'' for the language in which the text is expressed (see below), with in that page support for the text to be produced
+
|examples=<nowiki/>
+
*{{xpsoc|text}}
+
*{{xpsoc|text|sa}}
+
*{{xpsoc|text|see}}
+
*{{xpsoc|text|xmp}}
+
*{{xpsoc|text|req}}
+
*{{xpsoc|text|sa|de}}
+
*{{xpsoc|text|sa|en}}
+
*{{xpsoc|text|sa|nl}}
+
*{{xpsoc|text|sa||x}}
+
*{{xpsoc|text|sa|de|x}}
+
*{{xpsoc|text|sa|en|x}}
+
*{{xpsoc|text|sa|nl|x}}
+
 
+
If the subtemplate for the language in which the name is expressed is known to exist, and fall-back to English if the text is not available is not desired, then the subtemplate can more efficiently be called directly as follows:
+
*{{xpsoc|text/en|sa}}
+
*{{xpsoc|text/nl|sa}}
+
 
+
Formatting a number:
+
*<code><nowiki>12{{text|,}}345{{text|.}}67</nowiki></code> → 12{{text|,}}345{{text|.}}67
+
 
+
Compare:
+
*{{xpsoc|formatnum|12345.67}}
+
 
+
|seealso=<nowiki/>
+
*[[Template:Language]]
+
}}
+
 
+
[[Category:User interface language dependent templates|Language]]
+
[[Category:Set of templates, each containing multiple texts in one language]]
+
<div style="clear:both;" /><!--template:documentation--></div></div></noinclude>
+

Revision as of 17:09, 17 December 2011

|style="background:#eeeeee; text-align:center; border:solid #BABFA3; border-width:0px 1px 1px 0px; "|

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox