Zeile 1: |
Zeile 1: |
− | <includeonly><!-- | + | <includeonly><span style="white-space: nowrap; display:inline; margin-right:0;">{{#switch: {{lc:{{{1}}}}} |
| + | |1|01|spring|frühling = [[File:Spring.png|{{{width|24px}}}|link=]]{{#if:{{{2|}}}| {{{2|}}}}} [[Frühling]] |
| + | |2|02|summer|sommer = [[File:Summer.png|{{{width|24px}}}|link=]]{{#if:{{{2|}}}| {{{2|}}}}} [[Sommer]] |
| + | |3|03|fall|autumn|herbst = [[File:Fall.png|{{{width|24px}}}|link=]]{{#if:{{{2|}}}| {{{2|}}}}} [[Herbst]] |
| + | |4|04|winter = [[File:Winter.png|{{{width|24px}}}|link=]]{{#if:{{{2|}}}| {{{2|}}}}} [[Winter]] |
| + | |marriage|ehe = [[File:Mermaid's Pendant.png|{{{width|24px}}}|link=]] [[Ehe]] |
| + | |deviations|abweichungen = Abweichungen |
| + | |5|05|all|any|jahreszeiten|alle|alles|jede|jedes|immer|jeder|irgendein = [[File:All Seasons Icon.png|{{{width|24px}}}|link=]] [[Jahreszeiten|Alle]] |
| + | |#default = {{ucfirst:{{{1|}}} }} }}</span></includeonly><noinclude>{{Englishdoc}} |
| | | |
− | // Define the allowed values, with handling for various quirks/oddities.
| |
− | // 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)
| |
− | // 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, Any Season, Alle, Alles, Irgendein, Jede, Jedes, Ganzjährig, Alle Jahreszeiten, Immer, Jeder,
| |
− | ,Spring, Frühling,
| |
− | ,Summer, Sommer,
| |
− | ,Fall, Herbst, Autumn,
| |
− | ,Winter, Winter,
| |
− | ,Mermaid's Pendant, Ehe, Marriage,
| |
− | ,Deviations, Abweichungen,
| |
− | }}{{#arraydefine:$lang_allseasons | Alle }}<!--
| |
− |
| |
− | // 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}}}}<!--
| |
− |
| |
− | // Wrap a sort-key span around all items if requested. On other entries, add {{{space}}} or bullet.
| |
− | -->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0
| |
− | |{{{space| • }}}
| |
− | |{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}
| |
− | |<span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true
| |
− | |{{#expr:{{#if:{{#arrayprint:$slink_text}}
| |
− | |({{ParseInputValues|code=season|@season@|translate=index}}+1)*100
| |
− | |0}}{{#iferror:{{#expr:{{{2|0}}}>0}}|| + {{{2|0}}}}}}}
| |
− | |{{{sortkey|}}}}}}}">
| |
− | }}}}<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
| |
− | | |
− | {{#if:{{{size|}}}|{{{size}}}px|{{{width|24px}}}}} | link={{#arrayprint:$slink_text}} | alt=]] <!--
| |
− | // Add day if provided
| |
− | -->{{#if:{{{2|}}}|{{{2}}} }}<!--
| |
− |
| |
− | // 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>}}<!--
| |
− | -->{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}|</span>}}
| |
− | }}</includeonly><noinclude>{{Englishdoc}}
| |
| ==Verwendung== | | ==Verwendung== |
| Zur Verwendung dieser Vorlage kann man englishen oder deutschen Bezeichnungen verwenden, das Ergebnis ist dann auf deutsch. | | Zur Verwendung dieser Vorlage kann man englishen oder deutschen Bezeichnungen verwenden, das Ergebnis ist dann auf deutsch. |
Zeile 72: |
Zeile 17: |
| {{Season|Ehe}} | | {{Season|Ehe}} |
| {{Season|Deviations}} | | {{Season|Deviations}} |
| + | {{Season|All|width=48}} |
| {{Season|Irgendein}}</pre> | | {{Season|Irgendein}}</pre> |
| | | |
Zeile 85: |
Zeile 31: |
| | | |
| {{Season|Deviations}} | | {{Season|Deviations}} |
| + | |
| + | {{Season|All|width=48}} |
| | | |
| {{Season|Irgendein}} | | {{Season|Irgendein}} |