„Sablon:Weather inline” változatai közötti eltérés

Innen: Stardew Valley Wiki
Ugrás a navigációhoz Ugrás a kereséshez
(remove expensive parser function)
 
(3 közbenső módosítás ugyanattól a szerkesztőtől nincs mutatva)
1. sor: 1. sor:
<includeonly><!--
+
<includeonly><span style="display:inline; margin-right:0; white-space: nowrap;">{{#switch: {{lc:{{{1}}}}}
// Define the list of recognized weather names
+
|all|any|minden|bármilyen|mindegy|akármilyen = [[Időjárás|Minden]]
//  First column=icon name -> same in all languages
+
|sun|nap = [[File:Sunny.png|{{{width|16px}}}|link=]]&nbsp;[[Időjárás|Nap]]
//  Second column=displayed text -> needs translation
+
|springwind = [[File:Pollen spring.png|{{{width|16px}}}|link=]]&nbsp;[[Időjárás|Szél]]
//  All other values are synonyms
+
|rain|eső = [[File:Rain.png|{{{width|16px}}}|link=]]&nbsp;[[Időjárás|Eső]]
-->{{ParseInputValues|code=weather||
+
|festival|fesztivál = [[File:Festival.png|{{{width|16px}}}|link=]]&nbsp;[[Fesztiválok|Fesztivál]]
,Any,          Minden,All,  Always,
+
|fallwind = [[File:Pollen fall.png|{{{width|16px}}}|link=]]&nbsp;[[Időjárás|Szél]]
,Sunny,        Nap,  Sun,  Napos, 
+
|storm|zivatar|vihar = [[File:Thunderstorm.png|{{{width|16px}}}|link=]]&nbsp;[[Időjárás|Vihar]]
,Pollen fall,  Szél,  Wind,  Pollen, Polleny, Windy, Szeles,
+
|snow|hó = [[File:Snow.png|{{{width|16px}}}|link=]]&nbsp;[[Időjárás|]]
,Pollen spring, Szél,  Wind,  Springwind,
+
|#default = {{ucfirst:{{{1|}}} }}
,Rain,          Eső,  Rainy, Esős, 
+
}}</span></includeonly><noinclude>{{Englishdoc}}</noinclude>
,Thunderstorm,  Vihar, Storm, Stormy, Viharos,
 
,Snow,          Hó,    Snowy, Havas,
 
}}<!--
 
// The name of the weather wiki page
 
-->{{#arraydefine:$lang_weatherlink|Időjárás}}<!--
 
 
 
// 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}}}}<!--
 
 
 
// Wrap a sort-key span around all items if requested. On other entries, add {{{space}}} or bullet.
 
-->{{#ifexpr:{{#arraysearch:$wweather|@weather@}}>0
 
    |{{{space|&#32;•&#32;}}}
 
    |{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}
 
        |<span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true
 
          |{{#expr:{{#if:{{#arrayprint:$wlink_text}}
 
            |({{ParseInputValues|code=weather|@weather@|translate=index}}+1)
 
    |0}}}}
 
          |{{{sortkey|}}}}}}}">
 
  }}}}<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>}}<!--
 
-->{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}|</span>}}
 
}}</includeonly><noinclude>{{Englishdoc}}</noinclude>
 

A lap jelenlegi, 2022. május 22., 20:04-kori változata

A sablonnal kapcsolatos további információkért lásd a angol nyelvű dokumentációt.

Használat

Ezt a sablont az alábbi oldalak megadásával lehet használni.

{{Weather inline}}

Eredmények...