Template:Languages/doc: Difference between revisions

Safer nicotine wiki Tobacco Harm Reduction
Jump to navigation Jump to search
m (1 revision imported)
imported>Bellabellab
m (corrected "categories" to "categorizes")
 
Line 1: Line 1:
{{Languages|Template:Languages/doc}}
{{Documentation subpage}}
{{Documentation subpage}}
{{note|This template is outdated on this wiki, here we use the {{ll|Extension:Translate|translation system.}}}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
== Syntax ==


<nowiki>{{Languages|PageName}}</nowiki>
== Usage ==
=== General ===
This template is to be placed in template documentation of user languages. It is intended primarily for [[Wikipedia:Userboxes|userboxes]] (such as {{Tl|User en-ca-1}}), and it should {{Em|not}} be placed on mainspace articles. It is written as (example for English):
 
<nowiki>{{Languages|English|en}}</nowiki>
 
You write only ''English'' (not ''language'': the template writes that by itself).
 
=== Language void ===
For most languages, saying "language" after it is necessary to direct it straight to the language's mainspace page, but sometimes saying "language" directs it to a red link. To stop this problem put:
 
<nowiki>{{Languages|English|en|langvoid=}}</nowiki>
 
=== User space ===
Most language userboxes are in the template namespace. For those in user space, add the {{Para|userspace|yes}} parameter:
 
<nowiki>{{Languages|Southern American English|UBX/SoE|userspace=yes}}</nowiki>
 
=== Different category ===
This template automatically puts the template in its User template category, to redirect to a different User templates category do this, using Scottish English as an example:
 
<nowiki>{{Languages|Scottish English|en-sco|catalt=en}}</nowiki>  
 
=== Category sections ===
By default the template categorizes templates like:


* '''PageName''' (optional) - the name of the page to display language links for. If omitted then the English version of the current page is used. This parameter can normally be omitted, as it is only required if you want to link to a page other than the one you place the template on, which is very uncommon. If this parameter is used on a sub-page make sure you supply the root name, not the full page name (e.g. on [[MediaWiki/fr]] you would need to use <code><nowiki>{{Languages|MediaWiki}}</nowiki></code> and not <code><nowiki>{{Languages|MediaWiki/fr}}</nowiki></code>).
1<br>
[[Template:User en-1]]


== Usage ==
2<br>
[[Template:User en-2]]
 
And so on, but if you wanted to replace these with different abbreviations such as:


The template should only be placed on pages that exist in more than one language, and it should be placed in the same location on each translation of the page.
c<br>
[[Template:User en-ca-1]]<br>
[[Template:User en-ca-2]]<br>


The English version of a page is always the main version, with all other languages as sub-pages, named using the appropriate language code (see below).
e<br>
[[Template:User en-1]]<br>
[[Template:User en-2]]<br>


For example, on the Main Page you would include the text <code><nowiki>{{Languages}}</nowiki></code>, both on [[Main Page]] itself, and on each of its language sub-pages. The template automatically creates links to any language sub-pages that exist, e.g. <code>Main Page/ja</code>, <code>Main Page/fr</code>, and ignores non-existant languages.
Add <nowiki>|sections=</nowiki> with the abbreviated code, such as "ca" or "en", etc. Do {{Em|not}} place the "-", at the end of "sections" as was done previously, this will mess up the sorting.
<!--
=== # ===
This template automatically categorizes templates by number by default, but for some reason the parser functions do not work exactly right when using the "sections" option, as such the number override has to be used.


See [[Project:Language policy]] for further details about translating pages.
<nowiki>{{Languages|English|en|level=6|sections=en-|#=N}}</nowiki>
-->


=== TemplateData ===
===Voiding the category===
{{TemplateData header}}
Some templates, such as the [[Template:User blank|blank]] series and other fictional languages, do not need to have their own category. To void the category completely, use this [[wikitext]] [[Wikipedia:Wiki markup |markup text]]:
<templatedata>
{
"params": {
"1": {
"label": "Page Name",
"suggested": true,
"type": "wiki-page-name"
}
}
}
</templatedata>


== Supported languages ==
<code><nowiki>{{Languages|Spoken|blank|catvoid=}}</nowiki></code>


This shows you the name of each language's sub-page (using ''Main Page'' as an example). Other languages may be added easily as necessary. Please use the appropriate [[meta:List of Wikipedias|prefix, as used on Wikipedia]] when adding a new language. Please do ''not'' add languages for which no pages exist yet, as this will increase the time needed to include the template without adding any benefit (languages are only displayed to the user when the relevant page exists).
=== Format ===
If all of these functions were used on one template they would look like this:


The link on the language names goes to the Wikipedia in that language. '''If no Wikipedia in your language exists, do not add pages in that language to MediaWiki.org!''' This wiki is not the place for language advocacy - please go through the correct channels, and once your language has a Wikipedia then please return to add content here.
<nowiki>{{Languages|English|en|langvoid=|catvoid=|catalt=en|sections=us|#=N}}</nowiki>


{| class="wikitable sortable"
Please note catalt, sections and # cannot exist if catvoid exists.
! Page name || Language
|-
| Main Page || [[:en:|{{#language:en|{{int:lang}}}}]]
|-
| Main Page'''/af''' || [[:af:|{{#language:af|{{int:lang}}}}]]
|-
| Main Page'''/ar''' || [[:ar:|{{#language:ar|{{int:lang}}}}]]
|-
| Main Page'''/ast''' || [[:ast:|{{#language:ast|{{int:lang}}}}]]
|-
| Main Page'''/az''' || [[:az:|{{#language:az|{{int:lang}}}}]]
|-
| Main Page'''/ban''' || [[:ban:|{{#language:ban|{{int:lang}}}}]]
|-
| Main Page'''/bcc''' || {{#language:bcc|{{int:lang}}}}
|-
| Main Page'''/be''' || [[:be:|{{#language:be|{{int:lang}}}}]]
|-
| Main Page'''/be-tarask''' || [[:be-tarask:|{{#language:be-tarask|{{int:lang}}}}]]
|-
| Main Page'''/bg''' || [[:bg:|{{#language:bg|{{int:lang}}}}]]
|-
| Main Page'''/bn''' || [[:bn:|{{#language:bn|{{int:lang}}}}]]
|-
| Main Page'''/br''' || [[:br:|{{#language:br|{{int:lang}}}}]]
|-
| Main Page'''/bs''' || [[:bs:|{{#language:bs|{{int:lang}}}}]]
|-
| Main Page'''/ca''' || [[:ca:|{{#language:ca|{{int:lang}}}}]]
|-
| Main Page'''/ce''' || [[:ce:|{{#language:ce|{{int:lang}}}}]]
|-
| Main Page'''/ckb''' || [[:ckb:|{{#language:ckb|{{int:lang}}}}]]
|-
| Main Page'''/cs''' || [[:cs:|{{#language:cs|{{int:lang}}}}]]
|-
| Main Page'''/da''' || [[:da:|{{#language:da|{{int:lang}}}}]]
|-
| Main Page'''/de''' || [[:de:|{{#language:de|{{int:lang}}}}]]
|-
| Main Page'''/diq''' || [[:diq:|{{#language:diq|{{int:lang}}}}]]
|-
| Main Page'''/el''' || [[:el:|{{#language:el|{{int:lang}}}}]]
|-
| Main Page'''/eo''' || [[:eo:|{{#language:eo|{{int:lang}}}}]]
|-
| Main Page'''/es''' || [[:es:|{{#language:es|{{int:lang}}}}]]
|-
| Main Page'''/fa''' || [[:fa:|{{#language:fa|{{int:lang}}}}]]
|-
| Main Page'''/fi''' || [[:fi:|{{#language:fi|{{int:lang}}}}]]
|-
| Main Page'''/fr''' || [[:fr:|{{#language:fr|{{int:lang}}}}]]
|-
| Main Page'''/gl''' || [[:gl:|{{#language:gl|{{int:lang}}}}]]
|-
| Main Page'''/gu''' || [[:gu:|{{#language:gu|{{int:lang}}}}]]
|-
| Main Page'''/he''' || [[:he:|{{#language:he|{{int:lang}}}}]]
|-
| Main Page'''/hi''' || [[:hi:|{{#language:hi|{{int:lang}}}}]]
|-
| Main Page'''/hr''' || [[:hr:|{{#language:hr|{{int:lang}}}}]]
|-
| Main Page'''/hu''' || [[:hu:|{{#language:hu|{{int:lang}}}}]]
|-
| Main Page'''/hy''' || [[:hy:|{{#language:hy|{{int:lang}}}}]]
|-
| Main Page'''/id''' || [[:id:|{{#language:id|{{int:lang}}}}]]
|-
| Main Page'''/io''' || [[:io:|{{#language:io|{{int:lang}}}}]]
|-
| Main Page'''/is''' || [[:is:|{{#language:is|{{int:lang}}}}]]
|-
| Main Page'''/it''' || [[:it:|{{#language:it|{{int:lang}}}}]]
|-
| Main Page'''/ja''' || [[:ja:|{{#language:ja|{{int:lang}}}}]]
|-
| Main Page'''/jv''' || [[:jv:|{{#language:jv|{{int:lang}}}}]]
|-
| Main Page'''/ka''' || [[:ka:|{{#language:ka|{{int:lang}}}}]]
|-
| Main Page'''/kk''' || [[:kk:|{{#language:kk|{{int:lang}}}}]]
|-
| Main Page'''/km''' || [[:km:|{{#language:km|{{int:lang}}}}]]
|-
| Main Page'''/ko''' || [[:ko:|{{#language:ko|{{int:lang}}}}]]
|-
| Main Page'''/ko-kp''' || Korean (North Korea)
|-
| Main Page'''/ksh''' || [[:ksh:|{{#language:ksh|{{int:lang}}}}]]
|-
| Main Page'''/ku''' || [[:ku:|{{#language:ku|{{int:lang}}}}]]
|-
| Main Page'''/kw''' || [[:kw:|{{#language:kw|{{int:lang}}}}]]
|-
| Main Page'''/la''' || [[:la:|{{#language:la|{{int:lang}}}}]]
|-
| Main Page'''/lb''' || [[:lb:|{{#language:lb|{{int:lang}}}}]]
|-
| Main Page'''/map-bms''' || [[:map-bms:|{{#language:map-bms|{{int:lang}}}}]]
|-
| Main Page'''/min''' || [[:min:|{{#language:min|{{int:lang}}}}]]
|-
| Main Page'''/mk''' || [[:mk:|{{#language:mk|{{int:lang}}}}]]
|-
| Main Page'''/ml''' || [[:ml:|{{#language:ml|{{int:lang}}}}]]
|-
| Main Page'''/mr''' || [[:mr:|{{#language:mr|{{int:lang}}}}]]
|-
| Main Page'''/ms''' || [[:ms:|{{#language:ms|{{int:lang}}}}]]
|-
| Main Page'''/mwl''' || [[:mwl:|{{#language:mwl|{{int:lang}}}}]]
|-
| Main Page'''/nl''' || [[:nl:|{{#language:nl|{{int:lang}}}}]]
|-
| Main Page'''/no''' || [[:no:|{{#language:no|{{int:lang}}}}]]
|-
| Main Page'''/oc''' || [[:oc:|{{#language:oc|{{int:lang}}}}]]
|-
| Main Page'''/or''' || [[:or:|{{#language:or|{{int:lang}}}}]]
|-
| Main Page'''/pl''' || [[:pl:|{{#language:pl|{{int:lang}}}}]]
|-
| Main Page'''/ps''' || [[:ps:|{{#language:ps|{{int:lang}}}}]]
|-
| Main Page'''/pt''' || [[:pt:|{{#language:pt|{{int:lang}}}}]]
|-
| Main Page'''/pt-br''' || [[:pt:Português brasileiro|{{#language:pt-br|{{int:lang}}}}]]
|-
| Main Page'''/ro''' || [[:ro:|{{#language:ro|{{int:lang}}}}]]
|-
| Main Page'''/ru''' || [[:ru:|{{#language:ru|{{int:lang}}}}]]
|-
| Main Page'''/sc''' || [[:sc:|{{#language:sc|{{int:lang}}}}]]
|-
| Main Page'''/sd''' || [[:sd:|{{#language:sd|{{int:lang}}}}]]
|-
| Main Page'''/si''' || [[:si:|{{#language:si|{{int:lang}}}}]]
|-
| Main Page'''/sl''' || [[:sl:|{{#language:sl|{{int:lang}}}}]]
|-
| Main Page'''/sk''' || [[:sk:|{{#language:sk|{{int:lang}}}}]]
|-
| Main Page'''/sq''' || [[:sq:|{{#language:sq|{{int:lang}}}}]]
|-
| Main Page'''/sr''' || [[:sr:|{{#language:sr|{{int:lang}}}}]]
|-
| Main Page'''/so''' || [[:so:|{{#language:so|{{int:lang}}}}]]
|-
| Main Page'''/sv''' || [[:sv:|{{#language:sv|{{int:lang}}}}]]
|-
| Main Page'''/ta''' || [[:ta:|{{#language:ta|{{int:lang}}}}]]
|-
| Main Page'''/tg''' || [[:tg:|{{#language:tg|{{int:lang}}}}]]
|-
| Main Page'''/th''' || [[:th:|{{#language:th|{{int:lang}}}}]]
|-
| Main Page'''/tr''' || [[:tr:|{{#language:tr|{{int:lang}}}}]]
|-
| Main Page'''/uz''' || [[:uz:|{{#language:uz|{{int:lang}}}}]]
|-
| Main Page'''/uk''' || [[:uk:|{{#language:uk|{{int:lang}}}}]]
|-
| Main Page'''/vi''' || [[:vi:|{{#language:vi|{{int:lang}}}}]]
|-
| Main Page'''/yue''' || [[:zh-yue:|{{#language:zh-yue|{{int:lang}}}}]]
|-
| Main Page'''/yi''' || [[:yi:|{{#language:yi|{{int:lang}}}}]]
|-
| Main Page'''/zh''' || [[:zh:|{{#language:zh|{{int:lang}}}}]]
|-
| Main Page'''/zh-hans''' || {{#language:zh-hans|{{int:lang}}}}
|-
| Main Page'''/zh-hant''' || {{#language:zh-hant|{{int:lang}}}}
|-
| Main Page'''/zh-tw''' || {{#language:zh-tw|{{int:lang}}}}
|}


== Example ==
==See also==
* {{tl|Complang}}
* {{tl|Language table}}


Here is how the language bar looks on the [[MediaWiki]] page:
<includeonly>{{Sandbox other||
{{Languages|MediaWiki}}
<!-- PLEASE ADD CATEGORIES BELOW THIS LINE, THANKS. -->
[[Category:Language user templates| ]]


<includeonly>
<!-- PLEASE ADD INTERWIKIS BELOW THIS LINE, THANKS. -->
[[Category:Language templates{{#translation:}}]]
}}</includeonly>
</includeonly>

Latest revision as of 20:48, 14 March 2023

Usage

General

This template is to be placed in template documentation of user languages. It is intended primarily for userboxes (such as {{User en-ca-1}}), and it should not be placed on mainspace articles. It is written as (example for English):

{{Languages|English|en}}

You write only English (not language: the template writes that by itself).

Language void

For most languages, saying "language" after it is necessary to direct it straight to the language's mainspace page, but sometimes saying "language" directs it to a red link. To stop this problem put:

{{Languages|English|en|langvoid=}}

User space

Most language userboxes are in the template namespace. For those in user space, add the |userspace=yes parameter:

{{Languages|Southern American English|UBX/SoE|userspace=yes}}

Different category

This template automatically puts the template in its User template category, to redirect to a different User templates category do this, using Scottish English as an example:

{{Languages|Scottish English|en-sco|catalt=en}}

Category sections

By default the template categorizes templates like:

1
Template:User en-1

2
Template:User en-2

And so on, but if you wanted to replace these with different abbreviations such as:

c
Template:User en-ca-1
Template:User en-ca-2

e
Template:User en-1
Template:User en-2

Add |sections= with the abbreviated code, such as "ca" or "en", etc. Do not place the "-", at the end of "sections" as was done previously, this will mess up the sorting.

Voiding the category

Some templates, such as the blank series and other fictional languages, do not need to have their own category. To void the category completely, use this wikitext markup text:

{{Languages|Spoken|blank|catvoid=}}

Format

If all of these functions were used on one template they would look like this:

{{Languages|English|en|langvoid=|catvoid=|catalt=en|sections=us|#=N}}

Please note catalt, sections and # cannot exist if catvoid exists.

See also