Template:Altnames: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(multiple language support)
(Added support for Chinese enumeration comma)
Line 3: Line 3:
|#default={{#if: {{{game|}}}|In {{{game}}}, this entity is also tied to |This entity is also tied to }}
|#default={{#if: {{{game|}}}|In {{{game}}}, this entity is also tied to |This entity is also tied to }}
|:zh-cn={{#if: {{{game|}}}|在 {{{game}}} 中,此实体也绑定到 |此实体也绑定到 }}
|:zh-cn={{#if: {{{game|}}}|在 {{{game}}} 中,此实体也绑定到 |此实体也绑定到 }}
}}<!--
}}&nbsp;<!--
-->{{#if: {{{name1|}}} |  <code>{{{name1}}}</code> }}<!--
-->{{#if: {{{name1|}}} |  <code style=padding:0>{{{name1}}}</code> }}<!--
-->{{#if: {{{name2|}}} | , <code>{{{name2}}}</code> }}<!--
-->{{#if: {{{name2|}}} | {{#switch:{{{suf|}}}|#default=,&nbsp;|:zh-cn={{#if:{{{name3|}}}|、|&nbsp;和&nbsp;}}}}<code style=padding:0>{{{name2}}}</code> }}<!--
-->{{#if: {{{name3|}}} | , <code>{{{name3}}}</code> }}<!--
-->{{#if: {{{name3|}}} | {{#switch:{{{suf|}}}|#default=,&nbsp;|:zh-cn={{#if:{{{name4|}}}|、|&nbsp;和&nbsp;}}}}<code style=padding:0>{{{name3}}}</code> }}<!--
-->{{#if: {{{name4|}}} | , <code>{{{name4}}}</code> }}<!--
-->{{#if: {{{name4|}}} | {{#switch:{{{suf|}}}|#default=,&nbsp;|:zh-cn={{#if:{{{name5|}}}|、|&nbsp;和&nbsp;}}}}<code style=padding:0>{{{name4}}}</code> }}<!--
-->{{#if: {{{name5|}}} | , <code>{{{name5}}}</code> }}<!--
-->{{#if: {{{name5|}}} | {{#switch:{{{suf|}}}|#default=,&nbsp;|:zh-cn={{#if:{{{name6|}}}|、|&nbsp;和&nbsp;}}}}<code style=padding:0>{{{name5}}}</code> }}<!--
-->{{#if: {{{name6|}}} | , <code>{{{name6}}}</code> }}<!--
-->{{#if: {{{name6|}}} | {{#switch:{{{suf|}}}|#default=,&nbsp;|:zh-cn={{#if:{{{name7|}}}|、|&nbsp;和&nbsp;}}}}<code style=padding:0>{{{name6}}}</code> }}<!--
-->{{#if: {{{name7|}}} | , <code>{{{name7}}}</code> }}<!--
-->{{#if: {{{name7|}}} | {{#switch:{{{suf|}}}|#default=,&nbsp;|:zh-cn={{#if:{{{name8|}}}|、|&nbsp;和&nbsp;}}}}<code style=padding:0>{{{name7}}}</code> }}<!--
-->{{#if: {{{name8|}}} | , <code>{{{name8}}}</code> }}<!--
-->{{#if: {{{name8|}}} | {{#switch:{{{suf|}}}|#default=and|:zh-cn=和}} <code style=padding:0>{{{name8}}}</code> }}<!--
-->{{#switch:{{{suf|}}}|#default=.|:zh-cn=。}} {{{misc|}}} }}</includeonly></onlyinclude>
-->{{#switch:{{{suf|}}}|#default=.|:zh-cn=。}} {{{misc|}}} }}</includeonly></onlyinclude>


Line 24: Line 24:
* {{param|suf}} - ''Optional:'' This is a suffix that will be added to all elements of the template to display the content in the desired language (if it is translated into it). {{ModernNote|There should be a colon before the language code, for example ":es".}}
* {{param|suf}} - ''Optional:'' This is a suffix that will be added to all elements of the template to display the content in the desired language (if it is translated into it). {{ModernNote|There should be a colon before the language code, for example ":es".}}
=== Example ===
=== Example ===
<code><nowiki>{{altnames|name1=x|name2=y|name3=z}}</nowiki></code> would return as:
<code style=padding:0><nowiki>{{altnames|name1=x|name2=y|name3=z}}</nowiki></code> would return as:
{{altnames|name1=x|name2=y|name3=z}}
{{altnames|name1=x|name2=y|name3=z}}


<code><nowiki>{{altnames|name1=x|game={{game link|portal}}}}</nowiki></code> would return as:
<code style=padding:0><nowiki>{{altnames|name1=x|game={{game link|portal}}}}</nowiki></code> would return as:
{{altnames|name1=x|game={{game link|Portal}}}}<!--
{{altnames|name1=x|game={{game link|Portal}}}}<!--


Line 41: Line 41:
* {{param|suf}} - ''可选:''这是一个后缀,将添加到模板的所有元素中,以所需的语言显示内容(如果已翻译成该语言)。{{ModernNote|suf=:zh-cn|语言代码前应该有一个冒号,例如“:es”。}}
* {{param|suf}} - ''可选:''这是一个后缀,将添加到模板的所有元素中,以所需的语言显示内容(如果已翻译成该语言)。{{ModernNote|suf=:zh-cn|语言代码前应该有一个冒号,例如“:es”。}}
=== 示例 ===
=== 示例 ===
<code><nowiki>{{altnames|suf=:zh-cn|name1=x|name2=y|name3=z}}</nowiki></code> 会返回:
<code style=padding:0><nowiki>{{altnames|suf=:zh-cn|name1=x|name2=y|name3=z}}</nowiki></code> 会返回:
{{altnames|suf=:zh-cn|name1=x|name2=y|name3=z}}
{{altnames|suf=:zh-cn|name1=x|name2=y|name3=z}}


<code><nowiki>{{altnames|suf=:zh-cn|name1=x|game={{game link|portal}}}}</nowiki></code> 会返回:
<code style=padding:0><nowiki>{{altnames|suf=:zh-cn|name1=x|game={{game link|portal}}}}</nowiki></code> 会返回:
{{altnames|suf=:zh-cn|name1=x|game={{game link|Portal}}}}
{{altnames|suf=:zh-cn|name1=x|game={{game link|Portal}}}}
{{clr}}
{{clr}}

Revision as of 09:25, 7 January 2023

English (en)Deutsch (de)Esperanto (eo)Español (es)Français (fr)Suomi (fi)Hrvatski (hr)Magyar (hu)Italiano (it)日本語 (ja)한국어 (ko)Nederlands (nl)Polski (pl)Português (pt)Português do Brasil (pt-br)Русский (ru)Slovenčina (sk)Svenska (sv)Türkçe (tr)Українська (uk)Tiếng Việt (vi)中文 (zh)中文(臺灣) (zh-tw)
Curly brackets white.pngTemplate Documentation [view] [edit]
Icon-translate.png Available doc translations
Inline note templates
Template Pages using it
28 August 2024
{{note}} 6,436
{{warning}} 1,253
{{bug}} 1,192
{{tip}} 1,516
{{todo}} 1,628
{{inline note}} 2,188
{{confirm}} 672
{{question}} 11
{{fix}} 170
{{important}} 459
{{clarify}} 169
{{elaborate}} 18
{{main}} 143
{{distinguish}} 85
{{workaround}} 122
{{seealso}} 145
{{when}} 1
{{where}} 0
{{which}} 2
{{why}} 38
{{idea}} 21
{{placementTip}} 13
{{codenote}} 21
{{altnames}} 35
{{deprecated}} 109
{{how}} 23
{{example}} 16
{{confusion}} 53
{{thanks}} 7
{{code Fix}} 9 + 7 (16)
{{vote}} 4

This template is intended to be used when an entity is tied to multiple classnames, especially those that do not appear to serve any purpose other than deprecation.

Usage

Parameters

  • {{{name1}}} to {{{name8}}} - The alternate classnames.
  • {{{misc}}} - Optional: Use to display additional text in the same note.
  • {{{suf}}} - Optional: This is a suffix that will be added to all elements of the template to display the content in the desired language (if it is translated into it). Template:ModernNote

Example

{{altnames|name1=x|name2=y|name3=z}} would return as:

This entity is also tied to xyz.

{{altnames|name1=x|game={{game link|portal}}}} would return as:

In Portal Portal , this entity is also tied to x.