Template:Sandbox: Difference between revisions

From OLPC
Jump to navigation Jump to search
(doesn't seem to work :( last try before ditching it)
(testing a new to categorize)
Line 8: Line 8:
[[Category:Template]]
[[Category:Template]]


: <big>'''Testing: Missing translation<strike></strike>'''</big>
: <big>'''Testing: {{tl|Google Translations}}<strike></strike>'''</big>


</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>
</noinclude>{{#switch:{{lc:{{{2|{{{action|}}}}}}}}
|<!-- include action --> include={{:{{{page|{{#rel2abs:..}}}}}}}
|<!-- redirect action --> redirect
|<!-- missing action --> #default=#REDIRECT <nowiki>[[</nowiki>{{{page|{{#rel2abs:..}}}}}<nowiki>]]</nowiki>
}}
[[Category:Missing translation|{{PAGENAME}}]]
[[Category:Missing translation|{{PAGENAME}}]]
[[Category:Missing translation{{#if:{{{ar|}}}||s lang-ar}}]]
[[Category:Missing translation{{#if:{{{de|}}}||s lang-de}}]]
[[Category:Missing translation{{#if:{{{es|}}}||s lang-es}}]]
[[Category:Missing translation{{#if:{{{fr|}}}||s lang-fr}}]]
[[Category:Missing translation{{#if:{{{it|}}}||s lang-it}}]]
[[Category:Missing translation{{#if:{{{ja|}}}||s lang-ja}}]]
[[Category:Missing translation{{#if:{{{ko|}}}||s lang-ko}}]]
[[Category:Missing translation{{#if:{{{pt|}}}||s lang-pt}}]]
[[Category:Missing translation{{#if:{{{ru|}}}||s lang-ru}}]]
[[Category:Missing translation{{#if:{{{zh|}}}||s lang-zh}}]]
<noinclude>
<includeonly>[[Category:Missing translation lang-{{{lang|{{{1}}}}}}|{{PAGENAME}}]]</includeonly><noinclude>
<includeonly>[[Category:Missing translation lang-{{{lang|{{{1}}}}}}|{{PAGENAME}}]]</includeonly><noinclude>


Line 21: Line 28:


<nowiki>{{</nowiki>{{PAGENAME}}
<nowiki>{{</nowiki>{{PAGENAME}}
| lang = &lt;!-- UNNAMED #1 &mdash; language code of the missing translation (see [[Translating]] for codes) --&gt;
| title = &lt;!-- OPTIONAL -- title (defaults to 'Google'; --&gt;
| ''action'' = &lt;!-- UNNAMED #2 &mdash; OPTIONAL &mdash; what to do. Default is to '''REDIRECT''' to the ''parent page''. --&gt;
| ar = ''none'' &lt;!-- OPTIONAL -- hides link for arabic translation; --&gt;
| ''page'' = &lt;!-- OPTIONAL &mdash; the page name (sans enclosing ''[[]]'') to include or redirect to --&gt;
| de = ''none'' &lt;!-- OPTIONAL -- hides link for german translation; --&gt;
| es = ''none'' &lt;!-- OPTIONAL -- hides link for spanish translation; --&gt;
| fr = ''none'' &lt;!-- OPTIONAL -- hides link for french translation; --&gt;
| it = ''none'' &lt;!-- OPTIONAL -- hides link for italian translation; --&gt;
| ja = ''none'' &lt;!-- OPTIONAL -- hides link for japanese translation; --&gt;
| ko = ''none'' &lt;!-- OPTIONAL -- hides link for korean translation; --&gt;
| pt = ''none'' &lt;!-- OPTIONAL -- hides link for portuguese translation; --&gt;
| ru = ''none'' &lt;!-- OPTIONAL -- hides link for russing translation; --&gt;
| zh = ''none'' &lt;!-- OPTIONAL -- hides link for chinese (simplified) translation --&gt;
<nowiki>}}</nowiki>
<nowiki>}}</nowiki>

'''NOTE:''' If you '''name''' one of the parameters, the other also has to be named.


== Sample ==
== Sample ==


The following are all equivalents, as they all generate a <tt>REDIRECT</tt> directive to the upper level
The following are all equivalents, as they all generate a <tt>REDIRECT</tt> directive to the upper level
<nowiki>{{Missing translation|es}}</nowiki>
<nowiki>{{</nowiki>{{PAGENAME}}|es=none<nowiki>}}</nowiki>
{{{{PAGENAME}}|es=none}}
<nowiki>{{Missing translation|es|redirect}}</nowiki>
<nowiki>{{Missing translation|lang=es}}</nowiki>
<s><nowiki>{{Missing translation|lang=es|redirect}}</nowiki></s> # Doesn't work due to naming inconsistency
<nowiki>{{Missing translation|lang=es|action=redirect}}</nowiki>
<nowiki>{{Missing translation|lang=es|action=redirect|page=Foo}}</nowiki> # assuming the including page is <tt><nowiki>[[Foo/subpage]]</nowiki></tt>

If instead of <tt>REDIRECT</tt>ing you want to include the ''parent'' page, the following are equivalent:
<nowiki>{{Missing translation|es|include}}</nowiki>
<s><nowiki>{{Missing translation|lang=es|include}}</nowiki></s> # Doesn't work due to naming inconsistency
<nowiki>{{Missing translation|lang=es|action=include}}</nowiki>
<nowiki>{{Missing translation|lang=es|action=include|page=Foo}}</nowiki> # assuming the including page is <tt><nowiki>[[Foo/subpage]]</nowiki></tt>
# This would include the <tt><nowiki>[[Bar]]</nowiki></tt> page regardless of what the including page is.
<nowiki>{{Missing translation|lang=es|action=include|page=Bar}}</nowiki>



[[Category:Template|{{PAGENAME}}]]
[[Category:Template|{{PAGENAME}}]]

Revision as of 04:48, 25 July 2007

Many times you may want to just 'test' an idea for a template, I haven't found a sensible way of fully testing templates by themselves (as they will not get included in the edited version, but rather the saved version).

The idea of this {{Sandbox}} is to have that, a simple testing zone that will not interfere with others and avoid leaving a trail of botched attempts.

Please leave this comment/text for others to read.
See Also http://meta.wikimedia.org/wiki/Help:Template
Testing: {{Google Translations}}

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


Usage

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

Sample

The following are all equivalents, as they all generate a REDIRECT directive to the upper level

{{Sandbox|es=none}}

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