Template:Google Translations: Difference between revisions

From OLPC
Jump to navigation Jump to search
m (finished tweaking)
(re-implemented, changes semantics! (but is unused, so))
Line 1: Line 1:
<span class="plainlinks">{{{title|Google}}}<span style="display:{{{ar|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Car&hl=en&ie=UTF-8&oe=UTF-8 ar]</span><span style="display:{{{de|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cde&hl=en&ie=UTF-8&oe=UTF-8 de]</span><span style="display:{{{es|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Ces&hl=en&ie=UTF-8&oe=UTF-8 es]</span><span style="display:{{{fr|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cfr&hl=en&ie=UTF-8&oe=UTF-8 fr]</span><span style="display:{{{it|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cit&hl=en&ie=UTF-8&oe=UTF-8 it]</span><span style="display:{{{ja|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cja&hl=en&ie=UTF-8&oe=UTF-8 ja]</span><span style="display:{{{ko|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cko&hl=en&ie=UTF-8&oe=UTF-8 ko]</span><span style="display:{{{pt|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cpt&hl=en&ie=UTF-8&oe=UTF-8 pt]</span><span style="display:{{{ru|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cru&hl=en&ie=UTF-8&oe=UTF-8 ru]</span><span style="display:{{{zh-CN|inline}}}">/[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Czh-CN&hl=en&ie=UTF-8&oe=UTF-8 zh-CN]</span></span><noinclude>
<span class="plainlinks">''{{{title|Google}}}{{#if:{{{ar|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Car&hl=en&ie=UTF-8&oe=UTF-8 {{#language:ar}}]}}{{#if:{{{de|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cde&hl=en&ie=UTF-8&oe=UTF-8 {{#language:de}}]}}{{#if:{{{es|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Ces&hl=en&ie=UTF-8&oe=UTF-8 {{#language:es}}]}}{{#if:{{{fr|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cfr&hl=en&ie=UTF-8&oe=UTF-8 {{#language:fr}}]}}{{#if:{{{it|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cit&hl=en&ie=UTF-8&oe=UTF-8 {{#language:it}}]}}{{#if:{{{ja|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cja&hl=en&ie=UTF-8&oe=UTF-8 {{#language:ja}}]}}{{#if:{{{ko|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cko&hl=en&ie=UTF-8&oe=UTF-8 {{#language:ko}}]}}{{#if:{{{pt|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cpt&hl=en&ie=UTF-8&oe=UTF-8 {{#language:pt}}]}}{{#if:{{{ru|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Cru&hl=en&ie=UTF-8&oe=UTF-8 {{#language:ru}}]}}{{#if:{{{zh|}}}|'''-'''[http://translate.google.com/translate?u={{fullurl:{{FULLPAGENAME}}}}&langpair=en%7Czh-CN&hl=en&ie=UTF-8&oe=UTF-8 {{#language:zh-CN}}]}}''</span>
[[Category:Wanted translation|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{ar|}}}|s lang-ar}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{de|}}}|s lang-de}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{es|}}}|s lang-es}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{fr|}}}|s lang-fr}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{it|}}}|s lang-it}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{ja|}}}|s lang-ja}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{ko|}}}|s lang-ko}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{pt|}}}|s lang-pt}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{ru|}}}|s lang-ru}}|{{PAGENAME}}]]
[[Category:Wanted translation{{#if:{{{zh|}}}|s lang-zh}}|{{PAGENAME}}]]
<noinclude>


----
----


This template adds a series of automatic (machine) translation links to the including page. They use [[Google]] as the engine, and take [[English]] pages and translate it into:
This template adds a series of automatic (machine) translation links to the including page. They use [[Google]] as the engine, and takes a page in [[English]] and can translate it into one of the following:
* ar - [[arabic language|arabic]]
* ar - [[arabic language|arabic]] ({{#language:ar}})
* de - german
* de - german ({{#language:de}})
* es - [[spanish language|spanish]]
* es - [[spanish language|spanish]] ({{#language:es}})
* fr - [[french language|french]]
* fr - [[french language|french]] ({{#language:fr}})
* it - italian
* it - italian ({{#language:it}})
* ja - [[japanese]]
* ja - [[japanese]] ({{#language:ja}})
* ko - [[korean language|korean]]
* ko - [[korean language|korean]] ({{#language:ko}})
* ru - [[russian]]
* ru - [[russian]] ({{#language:ru}})
* zh-CN - [[chinese]] (simplified)
* zh - [[chinese]] (simplified) ({{#language:zh}})


== Usage ==
== Usage ==


In order to 'hide' some languages from the list (for example when there's a human translation available) you may specify for each language code "<tt>none</tt>" and will not be included.
In order to '''show''' languages from the list (for example when there isn't a human translation available) you may specify for each language code "<tt>show</tt>" and will not be included. When a human translation becomes available, just remove the parameter for the given language.


<nowiki>{{</nowiki> Google Translations
<nowiki>{{</nowiki> Google Translations
| title = &lt;!-- OPTIONAL -- title (defaults to 'Google'; --&gt;
| title = &lt;!-- OPTIONAL -- title (defaults to 'Google' --&gt;
| ar = ''none'' &lt;!-- OPTIONAL -- hides link for arabic translation; --&gt;
| ar = ''show'' &lt;!-- OPTIONAL -- shows link for arabic translation --&gt;
| de = ''none'' &lt;!-- OPTIONAL -- hides link for german translation; --&gt;
| de = ''show'' &lt;!-- OPTIONAL -- shows link for german translation --&gt;
| es = ''none'' &lt;!-- OPTIONAL -- hides link for spanish translation; --&gt;
| es = ''show'' &lt;!-- OPTIONAL -- shows link for spanish translation --&gt;
| fr = ''none'' &lt;!-- OPTIONAL -- hides link for french translation; --&gt;
| fr = ''show'' &lt;!-- OPTIONAL -- shows link for french translation --&gt;
| it = ''none'' &lt;!-- OPTIONAL -- hides link for italian translation; --&gt;
| it = ''show'' &lt;!-- OPTIONAL -- shows link for italian translation --&gt;
| ja = ''none'' &lt;!-- OPTIONAL -- hides link for japanese translation; --&gt;
| ja = ''show'' &lt;!-- OPTIONAL -- shows link for japanese translation --&gt;
| ko = ''none'' &lt;!-- OPTIONAL -- hides link for korean translation; --&gt;
| ko = ''show'' &lt;!-- OPTIONAL -- shows link for korean translation --&gt;
| pt = ''none'' &lt;!-- OPTIONAL -- hides link for portuguese translation; --&gt;
| pt = ''show'' &lt;!-- OPTIONAL -- shows link for portuguese translation --&gt;
| ru = ''none'' &lt;!-- OPTIONAL -- hides link for russing translation; --&gt;
| ru = ''show'' &lt;!-- OPTIONAL -- shows link for russing translation --&gt;
| zh-CN = ''none'' &lt;!-- OPTIONAL -- hides link for chinese (simplified) translation --&gt;
| zh = ''show'' &lt;!-- OPTIONAL -- shows link for chinese (simplified) translation --&gt;
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>


Line 35: Line 47:


# all languages included
# all languages included
<nowiki>{{</nowiki> Google Translations <nowiki>}}</nowiki>
<nowiki>{{</nowiki> Google Translations | ar=show | de=show | es=show | fr=show | it=show | ja=show | ko=show | pt=show | ru=show | zh=show <nowiki>}}</nowiki>
{{ Google Translations | ar=show | de=show | es=show | fr=show | it=show | ja=show | ko=show | pt=show | ru=show | zh=show }}
{{Google Translations}}
# all languages except ar (arabic), de (german), es (spanish), fr (french) nor it (italian)
<nowiki>{{</nowiki> Google Translations | ar = none | de = none | es = none | fr = none | it = none <nowiki>}}</nowiki>
{{Google Translations | ar = none | de = none | es = none | fr = none | it = none }}
# all languages except ja (japanese), ko (korean), pt (portuguese), ru (russian) nor zh-CN (chinese simplified)
<nowiki>{{</nowiki> Google Translations | ja = none | ko = none | pt = none | ru = none | zh-CN = none <nowiki>}}</nowiki>
{{Google Translations | ja = none | ko = none | pt = none | ru = none | zh-CN = none }}
# with title 'Automatic translations:' and all languages included
<nowiki>{{</nowiki> Google Translations | title = Automatic translations: <nowiki>}}</nowiki>
{{Google Translations | title = Automatic translations: }}
# No 'title' and all languages included
<nowiki>{{</nowiki> Google Translations | title =<nowiki>}}</nowiki>
{{Google Translations | title =}}


[[Category:Template]]</noinclude>
[[Category:Template|{{PAGENAME}}]]
[[Category:Templates using ParserFunctions|{{PAGENAME}}]]</noinclude>

Revision as of 05:21, 25 July 2007

Google



This template adds a series of automatic (machine) translation links to the including page. They use Google as the engine, and takes a page in English and can translate it into one of the following:

  • ar - arabic (العربية)
  • de - german (Deutsch)
  • es - spanish (español)
  • fr - french (français)
  • it - italian (italiano)
  • ja - japanese (日本語)
  • ko - korean (한국어)
  • ru - russian (русский)
  • zh - chinese (simplified) (中文)

Usage

In order to show languages from the list (for example when there isn't a human translation available) you may specify for each language code "show" and will not be included. When a human translation becomes available, just remove the parameter for the given language.

{{ Google Translations
   | title =       <!-- OPTIONAL -- title (defaults to 'Google' -->
   | ar = show     <!-- OPTIONAL -- shows link for arabic translation -->
   | de = show     <!-- OPTIONAL -- shows link for german translation -->
   | es = show     <!-- OPTIONAL -- shows link for spanish translation -->
   | fr = show     <!-- OPTIONAL -- shows link for french translation -->
   | it = show     <!-- OPTIONAL -- shows link for italian translation -->
   | ja = show     <!-- OPTIONAL -- shows link for japanese translation -->
   | ko = show     <!-- OPTIONAL -- shows link for korean translation -->
   | pt = show     <!-- OPTIONAL -- shows link for portuguese translation -->
   | ru = show     <!-- OPTIONAL -- shows link for russing translation -->
   | zh = show     <!-- OPTIONAL -- shows link for chinese (simplified) translation -->
}}

Sample

# all languages included
{{ Google Translations | ar=show | de=show | es=show | fr=show | it=show | ja=show | ko=show | pt=show | ru=show | zh=show }}

Google-العربية-Deutsch-español-français-italiano-日本語-한국어-português-русский-中文(中国大陆)