User:1416006136/Template:Lang/doc: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(Created page with "<noinclude>Category:English{{doc|0}}</noinclude>__NOTOC__ This template is an improved version of {{tl2|Otherlang2}}. It retains all the functionality and ''automatically'...")
 
(Redirected page to Template:Lang/doc)
Tag: New redirect
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
<noinclude>[[Category:English]]{{doc|0}}</noinclude>__NOTOC__
#REDIRECT [[Template:Lang/doc]]
This template is an improved version of {{tl2|Otherlang2}}. It retains all the functionality and ''automatically'' detects which languages a page has been translated into. It works on English and non-English pages, with or without namespaces. Otherlang2 may still be used, in the rare case that a translated page does not follow the wiki's [[Valve Developer Community:Alternative Languages|standard method]] for translated page titles.
 
Unlike {{tl2|Otherlang2}}, this template does not require any parameters to work on English pages. But other translation pages require an unnamed parameter to be defined to work. The contents of it should be the full name of the page the template is being applied on, including namespaces such as {{Code|Help:}}, {{Code|Template:}}, {{Code|User:}}, etc. It should not include any language suffixes, however, such as {{Code|:ru}}, {{Code|:es}}, {{Code|:zh-cn}}, etc. {{ModernNote|Capitalization matters, even on the first letter of the page name! Underscores must be replaced with spaces. <kbd>ai_changehintgroup</kbd> must be written as <kbd>Ai changehintgroup</kbd>. However, this parameter can be omitted if the page name is without a suffix.}}
 
{{todo|document {{param|up}}, {{param|1}}, {{param|2}}, {{param|3}}, {{param|4}}, {{param|5}}, {{param|6}}, {{param|7}}, {{param|8}}.}}
 
*The <code style="color:white">title</code> parameter can be used to change the text of the page titlebar (logically, into the text that should be displayed for the language of the page).
 
{{warning|on some pages you may receive this error: '''Warning''': Display title "env_cubemap" overrides earlier display title <nowiki>"<code>Env cubemap</code>"</nowiki>. This can be due to the fact that the page uses a different template in which the page title is set.}}
 
*The <code style="color:white">$title</code> parameter can be used to change the text of the page titlebar and place the title under the <nowiki><code></nowiki> tag - '''<nowiki>{{lang|Template:Lang|$title=$model}}</nowiki>'''.
 
*The <code style="color:white">notitle</code> parameter can be used to change the title of the site page itself, but not for the Title of the article itself.
 
*The <code style="color:white">noline</code> parameter can be set to 1 to hide the line under the title. If you don't plan on using it, don't bother defining it.
 
*The <code style="color:white">noborder</code> parameter can be set to 1 to hide the border around lang icons. If you don't plan on using it, don't bother defining it.
 
Here's an example for a hypothetical Spanish page called '''Category:Hello:es''':
<pre>{{lang|Category:Hello|title=Categoría:Hola|noline=1}}</pre>
 
This will add icons for all the versions of this page in different languages. It will also change the displayed title to a Spanish version of the name, and hide the line under the title.
 
{| class="standard-table sortable"
|+ Currently Supported Languages
! Language !! Page name !! Icon !! Icon Template
|-
|English                ||Page_name        ||{{en}}  ||{{tl|en}}
|-
|Catalan                ||Page_name:ca    ||{{ca}}  ||{{tl|ca}}
|-
|Czech                  ||Page_name:cs    ||{{cz}}  ||{{tl|cz}}
|-
|German                ||Page_name:de    ||{{de}}  ||{{tl|de}}
|-
|Spanish                ||Page_name:es    ||{{es}}  ||{{tl|es}}
|-
|Estonian              ||Page_name:et    ||{{et}}  ||{{tl|et}}
|-
|French                ||Page_name:fr    ||{{fr}}  ||{{tl|fr}}
|-
|Hungarian              ||Page_name:hu    ||{{hu}}  ||{{tl|hu}}
|-
|Italian                ||Page_name:it    ||{{it}}  ||{{tl|it}}
|-
|Dutch                  ||Page_name:nl    ||{{nl}}  ||{{tl|nl}}
|-
|Norwegian              ||Page_name:no    ||{{norway}} ||{{tl|norway}}
|-
|Polish                ||Page_name:pl    ||{{pl}}  ||{{tl|pl}}
|-
|Portuguese            ||Page_name:pt    ||{{pt}}  ||{{tl|pt}}
|-
|Portuguese (Brazilian) ||Page_name:pt-br  ||{{pt-br}} ||{{tl|pt-br}}
|-
|Russian                ||Page_name:ru    ||{{ru}}  ||{{tl|ru}}
|-
|Ukrainian              ||Page_name:uk    ||{{uk}}  ||{{tl|uk}}
|-
|Swedish                ||Page_name:sv    ||{{sv}}  ||{{tl|sv}}
|-
|Turkish                ||Page_name:tr    ||{{tr}}  ||{{tl|tr}}
|-
|Japanese              ||Page_name:ja    ||{{ja}}  ||{{tl|ja}}
|-
|Chinese (PRC)          ||Page_name:zh-cn  ||{{zh-cn}} ||{{tl|zh-cn}}
|-
|Chinese (Taiwan)      ||Page_name:zh-tw  ||{{zh-tw}} ||{{tl|zh-tw}}
|-
|Korean                ||Page_name:ko    ||{{ko}}  ||{{tl|ko}}
|-
|Georgian              ||Page_name:ka    ||{{ka}}  ||{{tl|ka}}
|-
|Hebrew                ||Page_name:he    ||{{he}}  ||{{tl|he}}
|}
*Also, this template automatically adds a page language category at the bottom of the page.
 
{{note|Most of these language codes are [[w:ISO 639|ISO 639]] codes.}}
 
<includeonly>[[Category:Translation templates]]</includeonly>

Latest revision as of 10:40, 23 February 2023

Redirect to: