「テンプレート:Language」の版間の差分

提供:脳科学辞典
ナビゲーションに移動 検索に移動
(1版)
(1版 をインポートしました)
 
(他の1人の利用者による、間の1版が非表示)
1行目: 1行目:
{{#ifeq:[[:Template:Language/{{#if:{{{2|}}}|{{{2}}}|{{uselang}}}}]]|{{language/{{#if:{{{2|}}}|{{{2}}}|{{uselang}}}}}}|{{#if:{{{3|}}}||{{language/en|{{{1|}}}}}}}|{{ifnotempty1|{{language/{{#if:{{{2|}}}|{{{2}}}|{{uselang}}}}|{{{1|}}}}}|{{#if:{{{3|}}}||{{language/en|{{{1|}}}}}}}}}}}<noinclude>
{{#language:{{{1|}}}|{{#if: {{{2|}}}
:''This template is outdated. Use <nowiki>{{#language:fr|de}}</nowiki> -> {{#language:fr|de}}.''
| {{{2|}}}
This template produces the word for a language given the language code, in a given language. By default, the fall-back language is English. Optionally this is suppressed, and the template produces nothing if the word is not available in the desired language. This can be useful if the English term is given anyway, with another call of the template.
| {{Int:Lang}}
 
}}}}<noinclude>{{Documentation}}</noinclude>
{{tdoc
|1=1
|1d=language code for the language name to be produced
|1def=
|2=2
|2d=language code for the language in which the name 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=
|i18n-method=autotranslate
|i18n-desc=
|name=Language
|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:Language/</code>''xx'' for the language in which the name is expressed, with in that page support for the language name to be produced:
{{Special:PrefixIndex/Template:Language/}}
They can be copied from commons (see [http://commons.wikimedia.org/w/index.php?title=Special%3APrefixIndex&prefix=Language%2F&namespace=10 list]), but the following modification is needed:
*the default is removed
|examples=<nowiki/>
*{{xpsoc|language}}
 
*{{xpsoc|language|ar}}
*{{xpsoc|language|de}}
*{{xpsoc|language|is}}
*{{xpsoc|language|nl}}
*{{xpsoc|language|zh-hant}}
 
*{{xpsoc|language|ar||x}}
*{{xpsoc|language|de||x}}
*{{xpsoc|language|is||x}}
*{{xpsoc|language|nl||x}}
*{{xpsoc|language|zh-hant||x}}
 
*{{xpsoc|language|ar|de}}
*{{xpsoc|language|de|de}}
*{{xpsoc|language|is|de}}
*{{xpsoc|language|nl|de}}
*{{xpsoc|language|zh-hant|de }}
 
*{{xpsoc|language|ar|de|x}}
*{{xpsoc|language|de|de|x}}
*{{xpsoc|language|is|de|x}}
*{{xpsoc|language|nl|de|x}}
*{{xpsoc|language|zh-hant|de|x}}
 
If the subtemplate for the language in which the name is expressed is known to exist, and fall-back to English if the word is not available is not desired, then the subtemplate can more efficiently be called directly as follows:
*{{xpsoc|language/nl|ar}}
*{{xpsoc|language/nl|de}}
*{{xpsoc|language/nl|is}}
*{{xpsoc|language/nl|nl}}
*{{xpsoc|language/nl|zh-hant}}
 
|seealso=<nowiki/>
*[[commons:Template:Language]]
*[[mw:Help:Magic_words#Miscellaneous #language]] - returns the local name of the language
*[[svn:/trunk/phase3/languages/Names.php]]
Similar to [[:en:Template:Language]] and [[:fr:Modèle:Langue-local]].
}}
 
[[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>

2020年7月25日 (土) 21:24時点における最新版

[create] Documentation icon Template documentation