Template: LanguageNative

From LibrePlanet
Jump to: navigation, search
m (debugging...)
m (Added a warning about editing this template)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<noinclude>
 
<noinclude>
 +
This is the &quot;LanguageNative&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
 +
-->
  
This is the &quot;LanguageNative&quot; sub-template. Edit the page to see the template text.
+
'''Description'''
  
Rev. 1.1 - Date: 25/01/2011
+
This template returns the native language of a given (2-digit lowercase) language code (ISO 639-1).  
  
'''Description''':
+
'''''Important note''''' - Altought it has been developed to be called as a sub-template from [[Template:Languages]], this template might be used everywhere. Please, '''do not edit''' if you are not REALLY sure about what you are doing.
  
This sub-template is designed to simplify [[Template:Languages]], by allowing a way to automatically display the native language name.
+
'''Usage'''
 
 
''IMPORTANT NOTE'' - This template should not be used anywhere except in the [[Template:Languages]] template. This sub-template doesn't display properly when not included. Please see [[Template:Languages]] for the complete version.
 
 
 
'''Usage''':
 
  
 
It should be called in the following format:
 
It should be called in the following format:
 
<pre>
 
<pre>
{{LanguageNative|Code}}
+
{{LanguageNative|<LangCode>}}
 
</pre>
 
</pre>
where 'Code' is the locale (ISO 639-1) of the native language name to display.
+
where:
</noinclude>
+
* <LangCode> is the (2-digit lowercase) language code (ISO 639-1) corresponding to the desired native language.
<onlyinclude><span lang="{{{1}}}" xml:lang="{{{1}}}">{{#switch:{{{1}}}
+
 
 +
If no <LangCode> matches, it returns by default the same given <LangCode>.
 +
</noinclude><onlyinclude>{{#if:{{{1|}}}|{{#switch:{{{1}}}
 
|aa=Afaraf
 
|aa=Afaraf
 
|ab=аҧсуа
 
|ab=аҧсуа
Line 59: Line 63:
 
|en=English
 
|en=English
 
|eo=Esperanto
 
|eo=Esperanto
|es=castellano
+
|es=español
 
|et=eesti
 
|et=eesti
 
|eu=euskara
 
|eu=euskara
Line 205: Line 209:
 
|zu=isiZulu
 
|zu=isiZulu
 
|#default={{{1}}}
 
|#default={{{1}}}
}}</span></onlyinclude>
+
}}|}}</onlyinclude>

Latest revision as of 15:04, 8 September 2011

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

Description

This template returns the native language of a given (2-digit lowercase) language code (ISO 639-1).

Important note - Altought it has been developed to be called as a sub-template from Template:Languages, this template might be used everywhere. Please, do not edit if you are not REALLY sure about what you are doing.

Usage

It should be called in the following format:

{{LanguageNative|<LangCode>}}

where:

  • <LangCode> is the (2-digit lowercase) language code (ISO 639-1) corresponding to the desired native language.

If no <LangCode> matches, it returns by default the same given <LangCode>.