Vorlage:Season: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(Revamp using new helper templates) |
|||
Zeile 1: | Zeile 1: | ||
− | <includeonly><span style="display:inline; margin-right:0;">{{# | + | <includeonly><!-- |
− | | | + | |
− | | | + | // Define the allowed values. Handling multiple quirks/oddities. Ideally, all of the names would work equally well |
− | | | + | // as displayed text, wiki page names, and icon names. But that's not possible. So top priority is to |
− | | | + | // create a list of valid page names. That's why 'Seasons' is primary name for 'All', 'Any', 'All Seasons' |
− | | | + | // Marriage, Deviations are for sake of NPC schedule sections (and translations) |
− | | | + | -->{{#arraydefine:$engl_seasons|Spring, Summer, Fall, Winter, Seasons, Marriage, Deviations, Fall, Seasons, Seasons, Seasons, Seasons, Seasons}}<!-- |
− | | | + | -->{{#arraydefine:$lang_seasons|Frühling, Sommer, Herbst, Winter, Jahreszeiten, Ehe, Abweichungen, Autumn, All, Any, Irgendein, Jedes, Ganzjährig}}<!-- |
− | |{{ | + | -->{{#arraydefine:$lang_allshort | Alle }}<!-- |
+ | -->{{#arraydefine:$lang_alllong | Alle Jahreszeiten}}<!-- | ||
+ | |||
+ | // END OF translated text | ||
+ | |||
+ | // Parse input data, then loop over all extracted entries | ||
+ | -->{{#arraydefine:$season|{{ParseInputValues|{{{1|}}}|{{#arrayprint:$engl_seasons}}|{{#arrayprint:$lang_seasons}}|default=true}}}}<!-- | ||
+ | -->{{#if:{{#arrayprint:$season}} | | ||
+ | <span style="display:inline; margin-right:0;"><!-- | ||
+ | -->{{#arrayprint:$season||@season@|<!-- | ||
+ | |||
+ | // Add space if this is not first entry | ||
+ | -->{{#ifexpr:{{#arraysearch:$season|@season@}}>0| }}<!-- | ||
+ | |||
+ | // Convert @season@ (english page name) into translated page name | ||
+ | -->{{#arraydefine:$link_text|{{#arrayindex:$lang_seasons|{{#arraysearch:$engl_seasons|@season@}}}}}}<!-- | ||
+ | |||
+ | // Display the non-icon, non-linkable cases: Devations, and unmatched text (detected by empty link_text) | ||
+ | // This is also how text_only option is handled | ||
+ | -->{{#ifeq:{{#arrayprint:$link_text}}| | ||
+ | | {{ucfirst:@season@}} | ||
+ | | {{#ifexpr: {{#ifeq:@season@|Deviations|1|0}} or {{#if:{{{text_only|}}}|1|0}} | ||
+ | | {{#if:{{{no_translate|}}}|@season@|{{#arrayprint:$link_text}}}} | ||
+ | | <!-- | ||
+ | |||
+ | // Display the normal cases: first display icon | ||
+ | -->[[File:{{#switch:@season@ | ||
+ | |Spring | ||
+ | |Summer | ||
+ | |Fall | ||
+ | |Winter = @season@ | ||
+ | |Seasons = All_Seasons_Icon | ||
+ | |Marriage = Mermaid's Pendant | ||
+ | }}.png | {{{width|24px}}} | link={{#arrayprint:$link_text}} | alt={{#arrayprint:$link_text}}]] <!-- | ||
+ | |||
+ | // Add link, with special treatment for text of All Seasons | ||
+ | -->[[{{#arrayprint:$link_text}}|<!-- | ||
+ | -->{{#ifeq:@season@|Seasons | ||
+ | |{{#if:{{{do_short|}}}|{{#arrayprint:$lang_allshort}}|{{#arrayprint:$lang_alllong}}}} | ||
+ | |{{#arrayprint:$link_text}}}}]]<!-- | ||
+ | -->}}}}}}</span>}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> | ||
+ | {{{{FULLPAGENAME}}/doc}} }}</noinclude> |
Version vom 3. September 2020, 02:10 Uhr
Details zur Vorlage finden Sie auf der englischsprachigen Dokumentationsseite.
Verwendung
Diese Vorlage kann verwendet werden, indem Sie auf eine relevante Seite folgendes eingeben.
{{Season}}
Ergibt... Vorlage:ParseInputValues