Template: Languages

From LibrePlanet
Jump to: navigation, search
(debugging...)
m (debugging...)
Line 2: Line 2:
 
This is the "Languages" template.
 
This is the "Languages" template.
  
It shows the available translations of a page. Only works if translations URL are in the "correct" way (i.e.: PageName/fr)
+
It shows the available translations of a page. Only works for the "original" page and its translations which include this template itself.
 +
 
 +
'''IMPORTANT NOTE''' - This template should be included either in the "original" page and all its translations ONLY when almost one translation page really exist.
  
 
It should be called in the following format:
 
It should be called in the following format:
 
<pre>
 
<pre>
{{Languages|PageName}}
+
{{Languages|master page=MasterPage|language=Code}}
 
</pre>
 
</pre>
 +
where:
 +
* '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)
 +
 +
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}}
  
 
Edit the page to see the template text.
 
Edit the page to see the template text.
Line 13: Line 24:
 
<includeonly>
 
<includeonly>
 
{{#ifeq:{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|format=count}}|0||<div style="text-align: left; background: #F7F7F7; border: 1px solid #B0BFE8; padding: 0.5em; ">
 
{{#ifeq:{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|format=count}}|0||<div style="text-align: left; background: #F7F7F7; border: 1px solid #B0BFE8; padding: 0.5em; ">
{{Languages/Title|{{{language}}}}} {{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|
+
{{LanguageOtherMsg|{{{language}}}}}&nbsp;&nbsp;{{#ask: [[master page::{{{master page}}}]] [[language code::!{{{language}}}]]|
 
   ?language code =|
 
   ?language code =|
 
   link=none|
 
   link=none|
 
   format=list|
 
   format=list|
   sep=,_|
+
   sep=&nbsp;&dot;&nbsp;_|
 
   template=LanguageLink|
 
   template=LanguageLink|
 
   sort = language code|
 
   sort = language code|

Revision as of 16:30, 23 January 2011

This is the "Languages" template.

It shows the available translations of a page. Only works for the "original" page and its translations which include this template itself.

IMPORTANT NOTE - This template should be included either in the "original" page and all its translations ONLY when almost one translation page really exist.

It should be called in the following format:

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

where:

  • '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)

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:

MyPage en en

  • in 'MyPage.it' include this:

MyPage it it

Edit the page to see the template text.