模板:Season:修订间差异
来自星露谷物语扩展百科
更多语言
更多操作
Nebulous Maestress(留言 | 贡献) m sync with english template |
Nebulous Maestress(留言 | 贡献) m sync with english template |
||
| 第29行: | 第29行: | ||
-->{{#arraydefine:$slink_text|{{ParseInputValues|code=season|@season@|translate=true}}}}<!-- | -->{{#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 | -->{{#ifexpr:{{#arraysearch:$sseason|@season@}}>0 | ||
| •  | |{{{space| • }}} | ||
|{{#if:{{{sortkey|}}}| | |{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}} | ||
<span | |<span data-sort-value="{{#ifeq:{{{sortkey}}}|||{{#ifeq:{{{sortkey|true}}}|true | ||
|{{#expr:{{#if:{{#arrayprint:$slink_text}} | |||
|({{ParseInputValues|code=season|@season@|translate=index}}+1)*100 | |({{ParseInputValues|code=season|@season@|translate=index}}+1)*100 | ||
|0}} | |0}}{{#iferror:{{#expr:{{{2|0}}}>0}}|| + {{{2|0}}}}}}} | ||
|{{{sortkey|}}}}}}}"> | |||
}}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!-- | }}}}<span style="display:inline; margin-right:0; white-space: nowrap"><!-- | ||
| 第61行: | 第61行: | ||
|{{#if:{{{all|}}}|{{{all|}}}|{{#arrayprint:$lang_allseasons}}}} | |{{#if:{{{all|}}}|{{{all|}}}|{{#arrayprint:$lang_allseasons}}}} | ||
|{{#arrayprint:$slink_text}}}}]]<!-- | |{{#arrayprint:$slink_text}}}}]]<!-- | ||
-->}}}}</span>}}}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> | -->}}}}</span>}}<!-- | ||
-->{{#ifexpr:{{#if:{{{sortkey|}}}|1|0}} or {{#ifeq:{{{sortkey}}}||1|0}}|</span>}} | |||
}}</includeonly><noinclude>{{Englishdoc}}{{#ifexist:{{FULLPAGENAME}}/doc |<nowiki/> | |||
{{{{FULLPAGENAME}}/doc}} }}</noinclude> | {{{{FULLPAGENAME}}/doc}} }}</noinclude> | ||
2020年10月31日 (六) 11:38的版本
描述
本模板用于显示季节信息,包括季节图标和对应的中文名称。该模板支持多种输入格式(数字、英文、中文等),并可选择性地显示具体日期。
参数
- 1(必需)
- 季节标识符,支持以下格式:
- 数字:1(春季)、2(夏季)、3(秋季)、4(冬季)、5(任意季节)
- 英文:spring、summer、fall/autumn、winter、all/any
- 中文:春季、夏季、秋季、冬季、季节/一年四季/所有季节/任意季节
- 特殊:marriage/婚姻/婚后、deviations/例外
- 2(可选)
- 具体日期数字,当提供时会在季节名称后显示“X 日”
- width(可选)
- 图标宽度,默认为 24px
用例
基本显示
{{Season|spring}}
{{Season|1}}
{{Season|春季}}
带日期的显示
{{Season|春季|15}}
{{Season|summer|28}}
{{Season|2|7}}
春季 15日
夏季 28日
夏季 7日
自定义图标大小
{{Season|winter|width=32px}}
{{Season|秋季|10|width=16px}}
秋季 10日
特殊季节类型
{{Season|任意季节}}
{{Season|all}}
{{Season|5}}
婚姻状态显示
{{Season|marriage}}
{{Season|婚后}}
例外情况
{{Season|deviations}}
{{Season|例外}}
例外
例外
无效输入处理
{{Season|invalid}}
{{Season|}}
Invalid
其他说明
- 大小写不敏感(通过 lc 函数)
- 默认图标尺寸为 24px
- 输入无效时,返回首字母大写的原始输入