Template:Language bar/doc: Difference between revisions

From Wikimedia UK
Jump to navigation Jump to search
(quick doc)
 
(Additional information)
Line 3: Line 3:
<pre>{{language bar}}</pre>
<pre>{{language bar}}</pre>


=== Alternative usage ===
=== Assumptions ===
This function is not yet completed.
This template assumes that the top-level page will the in English and any non-English versions will be in subpages.  It also assumes that the subpages will be named with the [[wikipedia:en:ISO 639|ISO 639]] code for that language.
 
{| class="prettytable" style="margin: 0 auto 0 auto;"
|+ For example
! Page name
! Description
!-
| Foo
| English-language rootpage
|-
| Foo/cy
| Welsh-language subpage
|-
| Foo/gd
| Scots Gaelic-language subpage
|}
 
The links created by the template depend on whether it is used on a rootpage or a subpage.  The template will automatically detect the existance of appropriate subpages and provide any links as appropriate.
 
=== Subpages as the top-level page ===
In some circumstances, the page with multilingual support will be a subpage.
 
{| class="prettytable" style="margin: 0 auto 0 auto;"
|+ For example
! Page name
! Description
!-
| Foo/Bar
| English-language subpage<br /><small>(to be treated as if it were a rootpage)</small>
|-
| Foo/Bar/cy
| Welsh-language subpage
|-
| Foo/Bar/gd
| Scots Gaelic-language subpage
|}
 
This would normally create a problem as the template would recognise the "top-level" English page as one of the non-English subpages. In order to force the template to treat a subpage as if it were the rootpage, the template should be entered as follows, '''but only one the top-level page'''.  The template should be entered as normal on all subpages.
 
<pre>{{language bar|root=1}}</pre>
<pre>{{language bar|root=1}}</pre>
=== Languages supported ===
This template only recognises and supports the following languages.  The template will need to be edited in order to support additional languages.
{| class="prettytable" style="margin:0 auto 0 auto;"
! ISO 639 code
! Language
|-
| ang || Old English
|-
| ar || Arabic
|-
| bn || Bengali
|-
| cy || Welsh
|-
| en || English
|-
| enm || Middle English
|-
| ga || Gaelic
|-
| gd || Scots Gaelic
|-
| gu || Gujarati
|-
| gv || Manx
|-
| kw || Kernowek
|-
| pa || Eastern Punjabi
|-
| pl || Polish
|-
| pnb || Western Punjabi
|-
| sco || Scots
|-
| ur || Urdu
|}


<includeonly><!-- CATEGORIES ETC -->
<includeonly><!-- CATEGORIES ETC -->
[[Category:Language templates]]
[[Category:Language templates|Bar, Language]]


</includeonly>
</includeonly>

Revision as of 12:22, 5 June 2013

Usage

This template create a bar to automatically link between different versions of the same page in different languages.

{{language bar}}

Assumptions

This template assumes that the top-level page will the in English and any non-English versions will be in subpages. It also assumes that the subpages will be named with the ISO 639 code for that language.

For example
Page name Description - Foo English-language rootpage
Foo/cy Welsh-language subpage
Foo/gd Scots Gaelic-language subpage

The links created by the template depend on whether it is used on a rootpage or a subpage. The template will automatically detect the existance of appropriate subpages and provide any links as appropriate.

Subpages as the top-level page

In some circumstances, the page with multilingual support will be a subpage.

For example
Page name Description - Foo/Bar English-language subpage
(to be treated as if it were a rootpage)
Foo/Bar/cy Welsh-language subpage
Foo/Bar/gd Scots Gaelic-language subpage

This would normally create a problem as the template would recognise the "top-level" English page as one of the non-English subpages. In order to force the template to treat a subpage as if it were the rootpage, the template should be entered as follows, but only one the top-level page. The template should be entered as normal on all subpages.

{{language bar|root=1}}

Languages supported

This template only recognises and supports the following languages. The template will need to be edited in order to support additional languages.

ISO 639 code Language
ang Old English
ar Arabic
bn Bengali
cy Welsh
en English
enm Middle English
ga Gaelic
gd Scots Gaelic
gu Gujarati
gv Manx
kw Kernowek
pa Eastern Punjabi
pl Polish
pnb Western Punjabi
sco Scots
ur Urdu