Template: Languages

From LibrePlanet
Jump to: navigation, search
m (fixing... ok)
(revision: 2.0)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
This is the &quot;Languages&quot; template. Edit the page to see the template text.
+
This is the &quot;'''Languages'''&quot; template. Edit the page to see the template text.
 +
<!--
 +
Coded by: alexus <http://libreplanet.org/wiki/User:Alexus>
 +
Revision: 2.0
 +
Date:    25/01/2011
 +
-->
  
Rev. 1.1 - Date: 25/01/2011
+
'''Description'''
  
'''Description''':
+
This template shows a bar linking to the available translations of a page. Only works for the pages (should be the "original" master page and its translations) which include this template itself.
  
This template shows the available translations of a page. Only works for the "original" page (master page) and its translations which include this template itself.
+
This template should be included, either in the "original" master page and in all its translations, ONLY IF almost one translation of the master page really exist in the wiki.
  
''IMPORTANT NOTE'' - This template should be included, either in the "original" page (master page) and in all its translations, ONLY IF almost one translation of the original page really exist in the wiki.
+
It also set the MediaWiki property 'Language code' of the page in which the template itself has being included (see below).
  
'''Usage''':
+
This template calls:
 +
* the &quot;LanguageOtherMsg&quot; sub-template
 +
* the &quot;LanguageNativeLink&quot; sub-template
 +
 
 +
'''Usage'''
  
 
It should be called in the following format:
 
It should be called in the following format:
 
<pre>
 
<pre>
{{Languages|master page=MasterPage|language=Code}}
+
{{Languages|master page=<MasterPage>|language=<LangCode>}}
 
</pre>
 
</pre>
 
where:
 
where:
* 'MasterPage' is the "original" page  
+
* <MasterPage> is the "original" master page
* 'Code' is the locale (ISO 639-1) for the language used for the content of the page in which the template has being included (either if the "original" or a translation page)
+
* <LangCode> is the (2-digit lowercase) language code (ISO 639-1) of the content in the page in which the template itself has being included (either if it is the "original" master page or one of its translations)
 +
 
 +
'''''Note''''' - This also set the MediaWiki property 'Language code' of the calling page to the <LangCode> parameter.
  
'''Example''':
+
'''Example'''
  
If the "original" page 'MyPage' is written in English (as more often is) and it has a Italian translation at the page 'MyPage.it", then:
+
If the "original" master page 'MyPage' is written in English (as more often is) and it has an Italian translation at the page 'MyPage/it", then:
* in 'MyPage', include this:
+
* into 'MyPage', include this:
 
<pre>
 
<pre>
 
{{Languages|master page=MyPage|language=en}}
 
{{Languages|master page=MyPage|language=en}}
 
</pre>
 
</pre>
* in 'MyPage.it', include this:
+
* in 'MyPage/it', include this:
 
<pre>
 
<pre>
 
{{Languages|master page=MyPage|language=it}}
 
{{Languages|master page=MyPage|language=it}}

Revision as of 16:32, 25 January 2011

This is the "Languages" template. Edit the page to see the template text.

Description

This template shows a bar linking to the available translations of a page. Only works for the pages (should be the "original" master page and its translations) which include this template itself.

This template should be included, either in the "original" master page and in all its translations, ONLY IF almost one translation of the master page really exist in the wiki.

It also set the MediaWiki property 'Language code' of the page in which the template itself has being included (see below).

This template calls:

  • the "LanguageOtherMsg" sub-template
  • the "LanguageNativeLink" sub-template

Usage

It should be called in the following format:

{{Languages|master page=<MasterPage>|language=<LangCode>}}

where:

  • <MasterPage> is the "original" master page
  • <LangCode> is the (2-digit lowercase) language code (ISO 639-1) of the content in the page in which the template itself has being included (either if it is the "original" master page or one of its translations)

Note - This also set the MediaWiki property 'Language code' of the calling page to the <LangCode> parameter.

Example

If the "original" master page 'MyPage' is written in English (as more often is) and it has an Italian translation at the page 'MyPage/it", then:

  • into 'MyPage', include this:
{{Languages|master page=MyPage|language=en}}
  • in 'MyPage/it', include this:
{{Languages|master page=MyPage|language=it}}