Différences entre versions de « Modèle:Weather inline »

De Stardew Valley Wiki
Sauter à la navigation Sauter à la recherche
(copy template from english wiki)
Ligne 1 : Ligne 1 :
<includeonly>{{#switch: {{lc:{{{1|}}}}}
+
<includeonly><!--
| sunny | sun | soleil | ensoleillé = [[File:Sunny.png|link=]]&nbsp;[[Météo|Soleil]]
+
// Define the list of recognized weather names
| rainy | rain | pluie | pluvieux = [[File:Rain.png|link=]]&nbsp;[[Météo|Pluie]]
+
//  First column=icon name -> same in all languages
| polleny | pollen | wind | windy | vent | venteux = [[File:Pollen_fall.png|link=]]&nbsp;[[Météo|Vent]]
+
//  Second column=displayed text -> needs translation
| springwind | vent du printemps = [[File:Pollen spring.png|link=]]&nbsp;[[Météo|Vent]]
+
//  All other values are synonyms
| stormy | storm | orage | orageux = [[File:Thunderstorm.png|link=]]&nbsp;[[Météo|Orage]]
+
-->{{ParseInputValues|code=weather||
| snowy | snow | neige | neigeux = [[File:Snow.png|link=]]&nbsp;[[Météo|Neige]]
+
,Any,          Toutes, All,  Always,    Tous,    Tout, 
| #default = <span style="color:red">WEATHER TEMPLATE ERROR</span>}}</includeonly><noinclude>{{Englishdoc}}</noinclude>
+
,Sunny,        Soleil, Sun,  Ensoleillé,
 +
,Pollen fall,  Vent,  Wind,  Pollen,    Polleny, Windy, Venteux,
 +
,Pollen spring, Vent,  Wind,  Springwind, Vent du printemps,
 +
,Rain,          Pluie,  Rainy, Pluvieux, 
 +
,Thunderstorm,  Orage,  Storm, Stormy,    Orageux,
 +
,Snow,          Neige,  Snowy, Neigeux,
 +
}}<!--
 +
// The name of the weather wiki page
 +
-->{{#arraydefine:$lang_weatherlink|Météo}}<!--
 +
 
 +
// 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>

Version du 26 septembre 2020 à 03:04

Voir la page de documentation en anglais pour plus d'informations sur ce modèle.

Utiliser

Ce modèle peut être utilisé en entrant ce qui suit dans une page pertinente.

{{Weather inline}}

Produit ... Modèle:ParseInputValues[[File:Modèle:ParseInputValues.png|

      | link=Météo| alt=]] [[Météo|Modèle:ParseInputValues]]