Difference between revisions of "Template:Translations"

From Creative Commons
Jump to: navigation, search
Line 1: Line 1:
<includeonly>
+
<includeonly>{{Translations/code
<div style="margin-bottom:15px;display:block;margin-top:5px;clear:both;">
+
|articles={{{articles|}}}
<table style="border:1px solid #AAAAAA; border-collapse:collapse; clear:both; font-size:85%; margin: 0.25em 0;width:100%;">
+
|rtl={{{rtl|}}}
<tr style="background: #EEF3E2">
+
|message-languages=Languages:
<th style="vertical-align:middle;white-space: nowrap; padding: 4px 1em; border-right: 1px solid #aaaaaa;width:15%;">[[File:Languages.png|link=CC Wiki:Translate|middle]] [[CC Wiki:Translate|Languages:]]</th>
+
|message-no-known-translations=There are no known versions of this page in other languages. Please read the directions on [[{{Translation of|CC Wiki:Translate}}|how to add a translation]].
<td style="background: #F6F9ED;padding-left:10px;">{{#if:{{{articles|}}}|{{#arraymap:{{{articles}}}|,|x|[[Has translation::x]]|,  }}|[[Category:Untranslated]] There are no known translations for this page. Please read the directions on [[CC Wiki:Translate|how to add a translation]].}}
+
}}</includeonly><noinclude>
{{#ifeq: {{NAMESPACE}} | {{ns:6}}<!--
+
Template '''{{PAGENAME}}''' is used to link an article in the wiki to its translations. To use it in your article, insert it as follows:
  the character ":" is not allowed in file names, so a space is used instead -
 
  if leftmost word is not a language code, language is content language -->
 
  | {{#ifeq: {{#language:{{lc:{{#explode:{{SUBPAGENAME}}| |0}}}}}}
 
      | {{lc:{{#explode:{{SUBPAGENAME}}| |0}}}}
 
      | [[Has language::{{CONTENTLANGUAGE}}| ]]
 
      | [[Has language::{{lc:{{#explode:{{SUBPAGENAME}}| |0}}}}| ]]
 
    }}
 
  | {{#ifeq:{{#explode:{{SUBPAGENAME}}|:|0}}|{{SUBPAGENAME}}
 
      | {{#ifeq:{{#explode:{{PAGENAME}}|:|0}}|{{PAGENAME}}
 
          | [[Has language::{{CONTENTLANGUAGE}}| ]]
 
          | {{#ifeq: {{#language:{{lc:{{#explode:{{PAGENAME}}|:|0}}}}}}
 
              | {{lc:{{#explode:{{PAGENAME}}|:|0}}}}
 
              | [[Has language::{{CONTENTLANGUAGE}}| ]]
 
              | [[Has language::{{lc:{{#explode:{{PAGENAME}}|:|0}}}}| ]]
 
            }}
 
        }}
 
      | {{#ifeq: {{#language:{{lc:{{#explode:{{SUBPAGENAME}}|:|0}}}}}}
 
          | {{lc:{{#explode:{{SUBPAGENAME}}|:|0}}}}
 
          | [[Has language::{{CONTENTLANGUAGE}}| ]]
 
          | [[Has language::{{lc:{{#explode:{{SUBPAGENAME}}|:|0}}}}| ]]
 
        }}
 
    }}
 
}}
 
</td>
 
</tr></table></div>
 
</includeonly><noinclude>
 
__NOEDITSECTION__
 
 
 
This is the <code>Translations</code> template.  It can be used to link to translations of an article in the wiki. To use it in your article, insert it as follows:
 
  
 
<pre>
 
<pre>
{{Translations|
+
{{Translations
  articles=Es:Foo,Hr:Bar
+
| articles = Es:Foo,Hr:Bar
 +
| rtl = True (optional)
 
}}
 
}}
 
</pre>
 
</pre>
Line 45: Line 17:
  
 
If no translations are specified, the page is marked as ''Untranslated''.
 
If no translations are specified, the page is marked as ''Untranslated''.
 +
 +
If the article is in a right-to-left language, use <code>rtl = True</code> to indicate it. Otherwise, omit this parameter.
 +
 +
This template is an interface to the real code, which is in [[Template:Translations/code]]. It provides the messages that the real code needs, in English. Please create a translation of it, providing to the real code the same messages, but translated to your language. Check [[Template:Pt:Traduções]] for an example of how to do this.
  
 
==See also==
 
==See also==
 
*[[CC Wiki:Translate]]
 
*[[CC Wiki:Translate]]
*[[Template:Translated_From]]
+
*[[Template:Translated From]]
 +
 
 +
{{Translations
 +
| articles = Template:Pt:Traduções
 +
}}
  
 
[[Category:Translation templates]]
 
[[Category:Translation templates]]
 +
__NOEDITSECTION__
 
</noinclude>
 
</noinclude>

Revision as of 21:40, 25 April 2011

Template Translations is used to link an article in the wiki to its translations. To use it in your article, insert it as follows:

{{Translations
| articles = Es:Foo,Hr:Bar
| rtl = True (optional)
}}

Any number of translations can be listed in the articles parameter, separated by commas.

If no translations are specified, the page is marked as Untranslated.

If the article is in a right-to-left language, use rtl = True to indicate it. Otherwise, omit this parameter.

This template is an interface to the real code, which is in Template:Translations/code. It provides the messages that the real code needs, in English. Please create a translation of it, providing to the real code the same messages, but translated to your language. Check Template:Pt:Traduções for an example of how to do this.

See also