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

提供: Stardew Valley Wiki
ナビゲーションに移動 検索に移動
(日本語入力に対応)
(sync with english template)
1行目: 1行目:
<includeonly>{{#switch: {{lc:{{{value|{{{1|}}}}}}}}
+
<includeonly><!--
| sunny | sun | 晴れ = [[File:Sunny.png|link=天気]]&nbsp;[[天気|晴れ]]
+
// Define the list of recognized weather names
| rainy | rain | = [[File:Rain.png|link=天気]]&nbsp;[[天気|雨]]
+
//  First column=icon name -> same in all languages
| polleny | pollen | wind | windy | 花粉 = [[File:Pollen_fall.png|link=天気]]&nbsp;[[天気|花粉]]
+
//  Second column=displayed text -> needs translation
| springwind | 風 = [[File:Pollen spring.png|link=]]&nbsp;[[天気|風]]
+
//  All other values are synonyms
| stormy | storm | 雷雨 = [[File:Thunderstorm.png|link=天気]]&nbsp;[[天気|雷雨]]
+
-->{{ParseInputValues|code=weather||
| snowy | snow | = [[File:Snow.png|link=天気]]&nbsp;[[天気|]]
+
,Any,          すべての天気, All,  Always,    なんでも,    すべて, 
| #default=<span style="color:red">WEATHER TEMPLATE ERROR</span>
+
,Sunny,        晴れ,    Sun, 
}}</includeonly><noinclude>{{englishdoc}}[[カテゴリ:テンプレート]]</noinclude>
+
,Pollen fall,  花粉,    Wind,  Pollen,    Polleny, Windy,
 +
,Pollen spring, 風,      Wind,  Springwind,
 +
,Rain,          雨,      Rainy,
 +
,Thunderstorm,  雷雨,    Storm, Stormy,   
 +
,Snow,          雪,      Snowy,
 +
}}<!--
 +
// The name of the weather wiki page
 +
-->{{#arraydefine:$lang_weatherlink|天気}}<!--
 +
 
 +
// END OF translated text
 +
 
 +
// Check whether there's already a file link in {{{1}}}... implying this is probably a recursive call.  Return immediately
 +
-->{{#if:{{#pos:{{{1|}}}|{{Bracket|2}}File}}|{{{1}}}|<!--
 +
// Parse input data, then loop over all extracted entries
 +
-->{{#arraydefine:$wweather|{{ParseInputValues|code=weather|{{{1|}}}|default=true}}}}<!--
 +
-->{{#arrayprint:$wweather||@weather@|<!--
 +
// Convert @weather@ (icon name) into displayed text
 +
-->{{#arraydefine:$wlink_text|{{ParseInputValues|code=weather|@weather@|translate=true}}}}<!--
 +
 
 +
// On first entry, add sort-key if requested. On other entries, add space and bullet.
 +
-->{{#ifexpr:{{#arraysearch:$wweather|@weather@}}>0
 +
    |&#32;•&#32;
 +
    |{{#if:{{{sortkey|}}}|
 +
        <span class="sortkey" style="display:none;">{{#if:{{#arrayprint:$wlink_text}}
 +
  |{{#expr:{{ParseInputValues|code=weather|@weather@|translate=index}}+1}}
 +
  |0}}</span>
 +
  }}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!--
 +
 
 +
// Display unmatched text (detected by empty value for $wlink_text)
 +
// And also handle text_only option
 +
-->{{#ifeq:{{#arrayprint:$wlink_text}}|
 +
    | {{ucfirst:@weather@}}
 +
    | {{#if:{{{text_only|}}}
 +
        | {{#if:{{{no_translate|}}}|@weather@|{{#arrayprint:$wlink_text}}}}
 +
| <!--
 +
 
 +
// Display the normal cases: first display icon (except for Any)
 +
-->{{#ifeq:@weather@|Any||[[File:@weather@.png|
 +
      {{#if:{{{size|}}}|{{{size}}}px}} | link={{#arrayprint:$lang_weatherlink}}| alt=]]&nbsp;}}<!--
 +
 
 +
// Add link
 +
-->[[{{#arrayprint:$lang_weatherlink}}|{{#arrayprint:$wlink_text}}]]<!--
 +
-->}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/>
 +
{{{{FULLPAGENAME}}/doc}} }}</noinclude>

2020年10月1日 (木) 05:08時点における版

このテンプレートの詳細については、英語のドキュメントページを参照してください。

使用法

このテンプレートは、関連するページに以下を入力することによって使用できます。

{{Weather inline}}

結果は... テンプレート:ParseInputValues[[File:テンプレート:ParseInputValues.png|

      | link=天気| alt=]] [[天気|テンプレート:ParseInputValues]]