Template:Strings subpage/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
 
(24 intermediate revisions by 6 users not shown)
Line 1: Line 1:
{{#switch:{{lc:{{SUBPAGENAME}}}}|en|en-gb|ab|ace|ady|aeb|aeb-latn|af|ak|aln|am|an|ang|anp|ar|arc|arn|arq|ary|arz|as|ase|ast|atj|av|avk|awa|ay|az|azb|ba|ban|bar|bbc|bcc|bcl|be|be-tarask|bg|bgn|bho|bi|bjn|bm|bn|bo|bpy|bqi|br|brh|bs|bto|bug|bxr|ca|cbk-zam|cdo|ce|ceb|ch|chr|chy|ckb|co|cps|cr|crh|crh-cyrl|cs|csb|cu|cv|cy|da|de|din|diq|dsb|dtp|dty|dv|dz|ee|egl|el|eml|eo|es|es-formal|et|eu|ext|fa|ff|fi|fit|fj|fo|fr|frc|frp|frr|fur|fy|ga|gag|gan|gan-hans|gcr|gd|gl|glk|gn|gom|gom-latn|gor|got|grc|gsw|gu|gv|ha|hak|haw|he|hi|hif|hil|hr|hrx|hsb|ht|hu|hy|ia|id|ie|ig|ii|ik|ike-latn|ilo|inh|io|is|it|iu|ja|jam|jbo|jut|jv|ka|kaa|kab|kbd|kbp|kg|khw|kiu|kk|kk-cn|kk-tr|kl|km|kn|ko|koi|krc|kri|krj|krl|ks|ks-deva|ksh|ku|kum|kv|kw|ky|la|lad|lb|lbe|lez|lfn|lg|li|lij|liv|lki|lmo|ln|lo|loz|lrc|lt|ltg|lus|luz|lv|lzh|lzz|mai|map-bms|mdf|mg|mhr|mi|min|mk|ml|mn|mo|mr|mrj|ms|mt|mwl|my|myv|mzn|na|nah|nan|nap|nds|nds-nl|ne|new|niu|nl|nn|no|nov|nrm|nso|nv|ny|nys|oc|olo|om|or|os|pa|pag|pam|pap|pcd|pdc|pdt|pfl|pi|pih|pl|pms|pnb|pnt|prg|ps|pt|pt-br|qu|qug|rgn|rif|rm|rmy|ro|roa-tara|ru|rue|rup|ruq|ruq-cyrl|rw|sa|sah|sat|sc|scn|sco|sd|sdc|sdh|se|sei|ses|sg|sgs|sh|shi|shn|si|sk|skr|sl|sli|sm|sma|sn|so|sq|sr|sr-el|srn|ss|st|stq|sty|su|sv|sw|szl|ta|tay|tcy|te|tet|tg|tg-latn|th|ti|tk|tl|tly|tn|to|tpi|tr|tru|ts|tt|tt-latn|tw|ty|tyv|tzm|udm|ug|ug-latn|uk|ur|uz|ve|vec|vep|vi|vis|vmf|vo|vot|vro|wa|war|wo|wuu|xal|xh|xmf|yi|yo|yue|za|zea|zh|zh-tw|zu|about|doc|preload={{doc|0}}|#default=}}
{{Doc/subpage}}
<onlyinclude>
<!-- Please place categories where indicated at the bottom of this page.) -->
<!-- Please place categories where indicated at the bottom of this page.) -->
A panel indicating that this page contains various translatable strings that are used in the template or anywhere else.
== Usage ==
{{Code|<nowiki>{{</nowiki>{{ROOTPAGENAME}}<nowiki>}}</nowiki>|select=1}} → {{ {{ROOTPAGENAME}} }}


<includeonly>{{sandbox other||
A panel indicating that the page it is on contains strings that are used in lieu of complicated #switch parser (or formerly, {{tl2|autolang}}(s)) on the base page.
== Looking for creating a Strings subpage? ==
If you are looking for creating a strings subpage, just create a "{{code|/strings}}" subpage, then paste the following code:
{{Expand|title=See the code|
{{CodeBlock|<nowiki>{{Strings subpage<!-- Don't forget to update once you add new translation to a strings. -->
|number = 1
| en = 1
| de = 1
| eo = 1
| es = 1
| fi = 1
| fr = 1
| ru = 1
| vi = 1
| zh = 1
}}
 
* {{{{PAGENAME}}|Example}}
 
<includeonly><onlyinclude>{{#switch:{{{1}}}<!-- Remember to keep this clean by sorting A-Z, and copy paste the tab space instead of pressing "SPACE" repeatedly. -->
 
| Example = {{#switch: {{language}}
| #default = Example
| de = Beispiel
| eo = Ekzemplo
| es = Ejemplo
| fi = Esimerkki
| fr = Exemple
| ru = Пример
| vi = Ví dụ
| zh = 示例
}}
 
}}</onlyinclude></includeonly>
</nowiki>}}
}}
 
{{Note|(Not required), but when you add a new language, it is recommended to sort the language codes from A to Z.}}
 
== Parameters and Examples ==
{| class="standard-table" width="100%"
! {{Dictionary/common|Param}}
! {{Dictionary/common|Desc}}
! {{Dictionary/common|Example}}
|-
| align="center" | No Parameters
| Places the template.
| {{CodeBlock|margin=5px|<nowiki>{{Strings subpage}}</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|number}}}}
| Number of strings.
| {{CodeBlock|margin=5px|<nowiki>| number = 6</nowiki>}}
|-
| align="center" | {{Code|style=2|{{Param|<language code>}}}}
| Number of translated strings into the specified language.
| {{CodeBlock|margin=5px|<nowiki>| en = 6</nowiki>}}{{CodeBlock|margin=5px|<nowiki>| eo = 3</nowiki>}}{{CodeBlock|margin=5px|<nowiki>| he = 2</nowiki>}}
|}
 
When creating a new strings subpage, click on the three dots in the top right of the documentation box and click "Strings". This will create a new strings subpage with the proper formatting already applied. Of course, this is not required and you can just create a new one from scratch if you so wish.
</onlyinclude>
{{Doc/Sandbox other|
<!-- Categories below this line, please -->
<!-- Categories below this line, please -->
[[Category:Templates]]
[[Category:Templates]]
}}</includeonly>
}}

Latest revision as of 10:27, 24 January 2025

Edit-copy.png
This is a documentation subpage for Template:Strings subpage.
Don't forget to purge the contents of the base page upon creating or editing this subpage.


A panel indicating that the page it is on contains strings that are used in lieu of complicated #switch parser (or formerly, {{autolang}}(s)) on the base page.

Looking for creating a Strings subpage?

If you are looking for creating a strings subpage, just create a "/strings" subpage, then paste the following code:

See the code
{{Strings subpage<!-- Don't forget to update once you add new translation to a strings. --> |number = 1 | en = 1 | de = 1 | eo = 1 | es = 1 | fi = 1 | fr = 1 | ru = 1 | vi = 1 | zh = 1 }} * {{{{PAGENAME}}|Example}} <includeonly><onlyinclude>{{#switch:{{{1}}}<!-- Remember to keep this clean by sorting A-Z, and copy paste the tab space instead of pressing "SPACE" repeatedly. --> | Example = {{#switch: {{language}} | #default = Example | de = Beispiel | eo = Ekzemplo | es = Ejemplo | fi = Esimerkki | fr = Exemple | ru = Пример | vi = Ví dụ | zh = 示例 }} }}</onlyinclude></includeonly>
Note.pngNote:(Not required), but when you add a new language, it is recommended to sort the language codes from A to Z.

Parameters and Examples

Parameter Description Example
No Parameters Places the template.
{{Strings subpage}}
{{{number}}} Number of strings.
| number = 6
{{{<language code>}}} Number of translated strings into the specified language.
| en = 6
| eo = 3
| he = 2

When creating a new strings subpage, click on the three dots in the top right of the documentation box and click "Strings". This will create a new strings subpage with the proper formatting already applied. Of course, this is not required and you can just create a new one from scratch if you so wish.