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

De Stardew Valley Wiki
Sauter à la navigation Sauter à la recherche
(copy template from english wiki)
Ligne 1 : Ligne 1 :
<includeonly><span style="display:inline; margin-right:0;">{{#switch: {{lc:{{{1|}}}}}
+
<includeonly><!--
| spring | printemps  = [[File:Spring.png|{{{width|24px}}}|link=Spring]]&nbsp;{{#if:{{{2|}}}|{{{2|}}}&nbsp;}}[[Printemps]]
+
 
| summer | été = [[File:Summer.png|{{{width|24px}}}|link=Summer]]&nbsp;{{#if:{{{2|}}}|{{{2|}}}&nbsp;}}[[Été]]
+
// Define the allowed values, with handling for various quirks/oddities.
| fall | autumn | automne = [[File:Fall.png|{{{width|24px}}}|link=Fall]]&nbsp;{{#if:{{{2|}}}|{{{2|}}}&nbsp;}}[[Automne]]
+
//  First column=icon name -> same in all languages
| winter | hiver  = [[File:Winter.png|{{{width|24px}}}|link=Winter]]&nbsp;{{#if:{{{2|}}}|{{{2|}}}&nbsp;}}[[Hiver]]
+
//  Second column=link (wiki page) name, generally same as displayed text -> needs translation
| marriage | mariage = [[File:Mermaid's Pendant.png|{{{width|24px}}}|link=Marriage]]&nbsp;[[Mariage]]
+
//  All other values are synonyms
| deviations | déviations = Déviations
+
// Marriage, Deviations are for sake of NPC schedule sections (and translations)
| all | any | tout | toute | tous | toutes = [[File:All_Seasons_Icon.png|{{{width|24px}}}|link=Saisons]]&nbsp;[[Saisons|Toutes les saisons]]
+
// For 'All Seasons' case, display text doesn't match icon or wiki-link, so
|{{ucfirst:{{{1|}}} }} }}</span></includeonly><noinclude>{{Englishdoc}}</noinclude>
+
// define default display text in $lang_allseasons, with parameter allowing any other preferred value
 +
-->{{ParseInputValues|code=season||
 +
,All Seasons Icon,  Saisons,    Seasons,  All, All Seasons, Any, Always, Any Season, Tout, Toute, Tous, Toutes, Toutes les saisons,
 +
,Spring,            Printemps,
 +
,Summer,            Été,
 +
,Fall,              Automne,    Autumn, 
 +
,Winter,            Hiver,
 +
,Mermaid's Pendant, Mariage,    Marriage,
 +
,Deviations,        Déviations,
 +
}}{{#arraydefine:$lang_allseasons | Toutes }}<!--
 +
 
 +
// 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:$sseason|{{ParseInputValues|{{{1|}}}|code=season|default=true}}}}<!--
 +
-->{{#arrayprint:$sseason||@season@|<!--
 +
 
 +
// Convert @season@ (icon name) into translated page name
 +
-->{{#arraydefine:$slink_text|{{ParseInputValues|code=season|@season@|translate=true}}}}<!--
 +
 
 +
// On first entry, add sort-key if requested. On other entries, add space and bullet.
 +
-->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0
 +
    |&#32;•&#32;
 +
    |{{#if:{{{sortkey|}}}|
 +
        <span class="sortkey" style="display:none;">{{#if:{{#arrayprint:$slink_text}}
 +
  |{{#expr:{{ParseInputValues|code=season|@season@|translate=index}}+1}}
 +
  |0}}</span>
 +
  }}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!--
 +
 
 +
// Display the non-icon, non-linkable cases: Deviations, and unmatched text (detected by empty link_text)
 +
// This is also where text_only option is handled
 +
-->{{#ifeq:{{#arrayprint:$slink_text}}|
 +
    | {{ucfirst:@season@}}
 +
    | {{#ifexpr: {{#ifeq:@season@|Deviations|1|0}} or {{#if:{{{text_only|}}}|1|0}}
 +
        | {{#if:{{{no_translate|}}}
 +
    |{{#ifeq:@season@|All Seasons Icon|All|@season@}}
 +
    |{{#ifeq:@season@|All Seasons Icon|{{#arrayprint:$lang_allseasons}}|{{#arrayprint:$slink_text}}}}}}
 +
|<!--
 +
 
 +
// Display the normal cases: first display icon
 +
-->[[File:@season@.png|
 +
    {{#if:{{{size|}}}|{{{size}}}px|{{{width|24px}}}}} | link={{#arrayprint:$slink_text}} | alt=]]&nbsp;<!--
 +
// Add day if provided
 +
-->{{#if:{{{2|}}}|{{{2}}}&nbsp;}}<!--
 +
 
 +
// Add link, with special treatment for text of All Seasons
 +
-->[[{{#arrayprint:$slink_text}}|<!--
 +
-->{{#ifeq:@season@|All Seasons Icon
 +
      |{{#if:{{{all|}}}|{{{all|}}}|{{#arrayprint:$lang_allseasons}}}}
 +
      |{{#arrayprint:$slink_text}}}}]]<!--
 +
-->}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/>
 +
{{{{FULLPAGENAME}}/doc}} }}</noinclude>

Version du 26 septembre 2020 à 03:03

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.

{{Season}}

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

    24px | link=Modèle:ParseInputValues | alt=]] [[Modèle:ParseInputValues|Modèle:ParseInputValues]]