Template: Languages

From LibrePlanet
Jump to: navigation, search
m (fixing infos)
(rev. 1.1 (now displays language links using native languages))
Line 2: Line 2:
 
This is the "Languages" template. Edit the page to see the template text.
 
This is the "Languages" template. Edit the page to see the template text.
  
Rev. 1.0 - Date: 23/01/2011
+
Rev. 1.1 - Date: 25/01/2011
  
 
'''Description''':
 
'''Description''':
  
This template shows the available translations of a page. Only works for the "original" 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.
  
''IMPORTANT NOTE'' - This template should be included, either in the "original" page and in all its translations, ONLY IF almost one translation of the original 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.
  
 
'''Usage''':
 
'''Usage''':
Line 18: Line 18:
 
where:
 
where:
 
* 'MasterPage' is the "original" page  
 
* 'MasterPage' is the "original" page  
* 'Code' is the locale of language of the page in which the template has being included (either if the "original" or a translation 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)
  
 
'''Example''':
 
'''Example''':
Line 31: Line 31:
 
{{Languages|master page=MyPage|language=it}}
 
{{Languages|master page=MyPage|language=it}}
 
</pre>
 
</pre>
 
+
</noinclude><includeonly>
</noinclude>
 
<includeonly>
 
 
{{#ifeq:{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|format=count}}|0||<div style="text-align: left; background: #f9f9f9; border: 1px solid #aaaaaa; padding: 0.1em 1.2em 0em 1.2em;">
 
{{#ifeq:{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|format=count}}|0||<div style="text-align: left; background: #f9f9f9; border: 1px solid #aaaaaa; padding: 0.1em 1.2em 0em 1.2em;">
 
'''[[Translation_Policy|{{LanguageOtherMsg|{{{language}}}}}]]''':&nbsp;&nbsp;{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|
 
'''[[Translation_Policy|{{LanguageOtherMsg|{{{language}}}}}]]''':&nbsp;&nbsp;{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|
Line 40: Line 38:
 
   format=list|
 
   format=list|
 
   sep=&nbsp;&#124;&nbsp;_|
 
   sep=&nbsp;&#124;&nbsp;_|
   template=LanguageLink|
+
   template=LanguageNativeLink|
 
   sort = language code|
 
   sort = language code|
 
   order = asc|
 
   order = asc|
Line 49: Line 47:
 
<div style="display: none; read: none;">
 
<div style="display: none; read: none;">
 
[[master page::{{{master page}}}]] [[language code::{{{language}}}]]
 
[[master page::{{{master page}}}]] [[language code::{{{language}}}]]
</div>
+
</div></includeonly>
</includeonly>
 

Revision as of 20:57, 24 January 2011

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

Rev. 1.1 - Date: 25/01/2011

Description:

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.

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.

Usage:

It should be called in the following format:

{{Languages|master page=MasterPage|language=Code}}

where:

  • 'MasterPage' is the "original" 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)

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:

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