Zeile 1: |
Zeile 1: |
| <includeonly><!-- | | <includeonly><!-- |
| | | |
− | // Define the allowed values. Handling multiple quirks/oddities. Ideally, all of the names would work equally well | + | // Define the allowed values, with handling for various quirks/oddities. |
− | // as displayed text, wiki page names, and icon names. But that's not possible. So top priority is to | + | // First column=icon name -> same in all languages |
− | // create a list of valid page names. That's why 'Seasons' is primary name for 'All', 'Any', 'All Seasons' | + | // 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) |
− | -->{{#arraydefine:$engl_seasons|Spring, Summer, Fall, Winter, Seasons, Marriage, Deviations, Fall, Seasons, Seasons, Seasons, Seasons, Seasons}}<!-- | + | // For 'All Seasons' case, display text doesn't match icon or wiki-link, so |
− | -->{{#arraydefine:$lang_seasons|Frühling, Sommer, Herbst, Winter, Jahreszeiten, Ehe, Abweichungen, Autumn, All, Any, Irgendein, Jedes, Ganzjährig}}<!--
| + | // define default display text in $lang_allseasons, with parameter allowing any other preferred value |
− | -->{{#arraydefine:$lang_allshort | Alle }}<!--
| + | -->{{ParseInputValues|code=season|| |
− | -->{{#arraydefine:$lang_alllong | Alle Jahreszeiten}}<!--
| + | ,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|}}}|{{#arrayprint:$engl_seasons}}|{{#arrayprint:$lang_seasons}}|default=true}}}}<!-- | + | -->{{#arraydefine:$sseason|{{ParseInputValues|{{{1|}}}|code=season|default=true}}}}<!-- |
− | -->{{#if:{{#arrayprint:$sseason}} |
| |
− | <span style="display:inline; margin-right:0; white-space: nowrap"><!--
| |
| -->{{#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|</span> • <span style="display:inline; margin-right:0; white-space: nowrap">}}<!-- | + | -->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0| • }}<!-- |
| + | --><span style="display:inline; margin-right:0; white-space: nowrap"><!-- |
| | | |
− | // Convert @season@ (english page name) into translated page name | + | // Convert @season@ (icon name) into translated page name |
− | -->{{#arraydefine:$slink_text|{{#arrayindex:$lang_seasons|{{#arraysearch:$engl_seasons|@season@}}}}}}<!-- | + | -->{{#arraydefine:$slink_text|{{ParseInputValues|code=season|@season@|translate=true}}}}<!-- |
| | | |
− | // Display the non-icon, non-linkable cases: Devations, and unmatched text (detected by empty link_text) | + | // Display the non-icon, non-linkable cases: Deviations, and unmatched text (detected by empty link_text) |
− | // This is also how text_only option is handled | + | // 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:{{#switch:@season@ | + | |
− | |Spring
| + | {{#if:{{{size|}}}|{{{size}}}px|{{{width|24px}}}}} | link={{#arrayprint:$slink_text}} | alt=]] <!-- |
− | |Summer
| |
− | |Fall
| |
− | |Winter = @season@
| |
− | |Seasons = All_Seasons_Icon
| |
− | |Marriage = Mermaid's Pendant
| |
− | }}.png | {{#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:{{{do_short|}}}|{{#arrayprint:$lang_allshort}}|{{#arrayprint:$lang_alllong}}}} | + | |{{#if:{{{all|}}}|{{{all|}}}|{{#arrayprint:$lang_allseasons}}}} |
| |{{#arrayprint:$slink_text}}}}]]<!-- | | |{{#arrayprint:$slink_text}}}}]]<!-- |
− | -->}}}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> | + | -->}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> |
| {{{{FULLPAGENAME}}/doc}} }}</noinclude> | | {{{{FULLPAGENAME}}/doc}} }}</noinclude> |