Vorlage:Season: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
(sync with english template) |
(new format for list of allowed values) |
||
Zeile 1: | Zeile 1: | ||
<includeonly><!-- | <includeonly><!-- | ||
− | // Define the allowed values | + | // Define the allowed values, with handling for various quirks/oddities. |
− | // as displayed text | + | // First column=icon name -> same in all languages |
− | // | + | // Second column=link (wiki page) name, generally same as displayed text -> needs translation |
+ | // All other values are synonyms | ||
// Marriage, Deviations are for sake of NPC schedule sections (and translations) | // Marriage, Deviations are for sake of NPC schedule sections (and translations) | ||
− | -->{{ | + | // For 'All Seasons' case, display text doesn't match icon or wiki-link, so |
− | + | // define default display text in $lang_allseasons, with parameter allowing any other preferred value | |
− | + | -->{{ParseInputValues|code=season|| | |
− | + | ,All Seasons Icon, Jahreszeiten, Seasons, All, All Seasons, Any, Always, Irgendein, Jedes, Ganzjährig, | |
+ | ,Spring, Frühling, | ||
+ | ,Summer, Sommer, | ||
+ | ,Fall, Herbst, Autumn, | ||
+ | ,Winter, Winter, | ||
+ | ,Mermaid's Pendant, Ehe, | ||
+ | ,Deviations, Abweichungen, | ||
+ | }}{{#arraydefine:$lang_allseasons | Alle }}<!-- | ||
// END OF translated text | // END OF translated text | ||
Zeile 15: | Zeile 23: | ||
-->{{#if:{{#pos:{{{1|}}}|{{Bracket|2}}File}}|{{{1}}}|<!-- | -->{{#if:{{#pos:{{{1|}}}|{{Bracket|2}}File}}|{{{1}}}|<!-- | ||
// Parse input data, then loop over all extracted entries | // Parse input data, then loop over all extracted entries | ||
− | -->{{#arraydefine:$sseason|{{ParseInputValues|{{{1|}}}| | + | -->{{#arraydefine:$sseason|{{ParseInputValues|{{{1|}}}|code=season|default=true}}}}<!-- |
− | |||
− | |||
-->{{#arrayprint:$sseason||@season@|<!-- | -->{{#arrayprint:$sseason||@season@|<!-- | ||
− | |||
// Add space and bullet if this is not first entry | // Add space and bullet if this is not first entry | ||
− | -->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0| | + | -->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0| • }}<!-- |
+ | --><span style="display:inline; margin-right:0; white-space: nowrap"><!-- | ||
− | // Convert @season@ ( | + | // Convert @season@ (icon name) into translated page name |
− | -->{{#arraydefine:$slink_text|{{ | + | -->{{#arraydefine:$slink_text|{{ParseInputValues|code=season|@season@|translate=true}}}}<!-- |
− | // Display the non-icon, non-linkable cases: | + | // Display the non-icon, non-linkable cases: Deviations, and unmatched text (detected by empty link_text) |
− | // This is also | + | // This is also where text_only option is handled |
-->{{#ifeq:{{#arrayprint:$slink_text}}| | -->{{#ifeq:{{#arrayprint:$slink_text}}| | ||
| {{ucfirst:@season@}} | | {{ucfirst:@season@}} | ||
| {{#ifexpr: {{#ifeq:@season@|Deviations|1|0}} or {{#if:{{{text_only|}}}|1|0}} | | {{#ifexpr: {{#ifeq:@season@|Deviations|1|0}} or {{#if:{{{text_only|}}}|1|0}} | ||
− | | {{#if:{{{no_translate|}}}|@season@|{{#arrayprint:$slink_text}}}} | + | | {{#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 | // Display the normal cases: first display icon | ||
− | -->[[File | + | -->[[File:@[email protected]| |
− | + | {{#if:{{{size|}}}|{{{size}}}px|{{{width|24px}}}}} | link={{#arrayprint:$slink_text}} | alt=]] <!-- | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
// Add link, with special treatment for text of All Seasons | // Add link, with special treatment for text of All Seasons | ||
-->[[{{#arrayprint:$slink_text}}|<!-- | -->[[{{#arrayprint:$slink_text}}|<!-- | ||
− | -->{{#ifeq:@season@|Seasons | + | -->{{#ifeq:@season@|All Seasons Icon |
− | |{{#if:{{{ | + | |{{#if:{{{all|}}}|{{{all|}}}|{{#arrayprint:$lang_allseasons}}}} |
|{{#arrayprint:$slink_text}}}}]]<!-- | |{{#arrayprint:$slink_text}}}}]]<!-- | ||
− | --> | + | -->}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> |
{{{{FULLPAGENAME}}/doc}} }}</noinclude> | {{{{FULLPAGENAME}}/doc}} }}</noinclude> |
Version vom 9. September 2020, 20:11 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[[File:Vorlage:ParseInputValues.png|
24px | link=Vorlage:ParseInputValues | alt=]] [[Vorlage:ParseInputValues|Vorlage:ParseInputValues]]