From Test-Scratch-Wiki

< Template:Translate

Line 61: Line 61:
  
 
==Used templates==
 
==Used templates==
[[Template:Translate/BoxLink]]
+
* [[Template:Translate/BoxLink]]
[[Template:Translate/TableTestLink]]
+
* [[Template:Translate/TableTestLink]]
[[Template:Translate/TableLink]]
+
* [[Template:Translate/TableLink]]
[[Template:Translate/InterwikiLink]]
+
* [[Template:Translate/InterwikiLink]]

Revision as of 23:09, 21 May 2016

Documentation This is a documentation subpage for Template:Translate (see that page for the template itself).
It contains usage information, categories and other content that is not part of the original template page.

Usage

This template is used to standardize the Switch Language templates found on various pages. This is to make it easier to make such templates, and to ensure that there are not huge variations.

Parameters

This template takes several parameters, all of which are the name of the article in that language.

=Value>|<Es =Value>|<Fr =Value>|<more>}}

If the English article lacks the "En:" suffix, use the "EnAlternate" parameter instead. EnAlternate takes the full title of the English article.

=Value>|<Es =Value>|<Fr =Value>|<more>}}

The list of supported languages is:

En - English
Es - Spanish
Fr - French
It - Italian
Pl - Polski
Pt - Portugese
Tr - Turkish

Examples

This template links to the article "Doughnut" in English, Italian, and Portuguese

{{Translate|En=Doughnut|It=Ciambella|Pt=rosquinha}}

The next example sets "title" to "ExampleXY" so that "Translate" is replaced by it

The next example sets "info" to "this is an additional" info so that this is added at the end.

Adding languages

Test Wiki languages

To add a test wiki, you need to do the following steps:

  • In the template, scroll to 3. and paste a new line with the following, replacing the language prefix (Es) and name (Español) with those of the respective language:
{{Translate/BoxLink|Es|Español|{{#ifeq: {{{Es|}}}|{{{Es|-}}}|{{{Es}}}|}}}}
  • Then, move to 6. and do the same for this code (you only need the language prefix here):
{{Translate/TableTestLink|Es|{{#ifeq: {{{Es|}}}|{{{Es|-}}}|{{{Es}}}|}}}}

Real Wiki languages

To add a real wiki, you need to do the following steps:

  • Make sure the language is registered in Special:Interwiki and make sure you are using the right language prefix.
  • In the template, scroll to 7. and paste a new line with the following, replacing the language prefix (En) with that of the respective language:
{{Translate/TableLink|En|{{#ifeq: {{{En|}}}|{{{En|-}}}|{{{En}}}|}}}}
  • Then, move to 10. and do the same for this code:
{{Translate/InterwikiLink|En|{{#ifeq: {{{En|}}}|{{{En|-}}}|{{{En}}}|}}}}

Used templates

Cookies help us deliver our services. By using our services, you agree to our use of cookies.