„Sablon:Season” változatai közötti eltérés
Ugrás a navigációhoz
Ugrás a kereséshez
(sync with english template) |
|||
1. sor: | 1. sor: | ||
− | <includeonly>< | + | <includeonly><!-- |
− | | | + | |
− | | | + | // 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, Évszakok, Seasons, All, All Seasons, Any, Always, Any Season, Minden, Bármilyen, Akármilyen, Minden évszak, | ||
+ | ,Spring, Tavasz, Tavaszi, | ||
+ | ,Summer, Nyár, Nyári, | ||
+ | ,Fall, Ősz, Autumn, | ||
+ | ,Winter, Tél, Téli, | ||
+ | ,Mermaid's Pendant, Házasság, Marriage, | ||
+ | ,Deviations, Eltérések, | ||
+ | }}{{#arraydefine:$lang_allseasons | Minden }}<!-- | ||
+ | |||
+ | // 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 | ||
+ | | •  | ||
+ | |{{#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=]] <!-- | ||
+ | // 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>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> | ||
+ | {{{{FULLPAGENAME}}/doc}} }}</noinclude> |
A lap 2020. szeptember 30., 23:26-kori változata
A sablonnal kapcsolatos további információkért lásd a angol nyelvű dokumentációt.
Használat
Ezt a sablont az alábbi oldalak megadásával lehet használni.
{{Season}}
Eredmények... Sablon:ParseInputValues[[File:Sablon:ParseInputValues.png|
24px | link=Sablon:ParseInputValues | alt=]] [[Sablon:ParseInputValues|Sablon:ParseInputValues]]