Jump to content

Template:Translation of: Difference between revisions

From CC Public Wiki
Created page with "{{#if:{{{1|}}} | {{#if: {{#ask: [[Has language::{{#ask:[[:{{{2|{{PAGENAME}}}}}]]|?Has language#=}}]] [[Translated from::{{{1}}}]] }} | {{..."
 
No edit summary
Line 1: Line 1:
{{#if:{{{1|}}}
{{#if:{{{1|}}}
   | {{#if: {{#ask: [[Has language::{{#ask:[[:{{{2|{{PAGENAME}}}}}]]|?Has language#=}}]]
   | {{#if: {{#ask: [[Has language::{{#ask:[[:{{{2|{{PAGENAME}}}}}]]|?Has language=}}]]
                   [[Translated from::{{{1}}}]]
                   [[Translated from::{{{1}}}]]
           }}
           }}
       |    {{#ask: [[Has language::{{#ask:[[:{{{2|{{PAGENAME}}}}}]]|?Has language#=}}]]
       |    {{#ask: [[Has language::{{#ask:[[:{{{2|{{PAGENAME}}}}}]]|?Has language=}}]]
                   [[Translated from::{{{1}}}]]
                   [[Translated from::{{{1}}}]]
           }}  
           }}  
Line 17: Line 17:


==Examples==
==Examples==
===1. Translation exists===
<pre>
{{Translation of|Main Page|CC Wiki:De:Übersetzen}}
</pre>
returns the translation of [[Main Page]] in the same language as page [[CC Wiki:De:Übersetzen]], that is, the translation of [[Main Page]] in language De:
{{Translation of|Main Page|CC Wiki:De:Übersetzen}}
===2. Translation does not exist===
<pre>
<pre>
{{Translation of|Main Page|Pt:Tradução}}
{{Translation of|Main Page|Hr:Odabir licence}}
</pre>
</pre>
{{Translation of|Main Page|Pt:Tradução}}
returns the translation of [[Main Page]] in the same language as page [[Hr:Odabir licence]], that is, the translation of [[Main Page]] in language Hr (at the time of writing this translation did not exist):
 
{{Translation of|Main Page|Hr:Odabir licence}}
 
===3. Language does not exist===
<pre>
{{Translation of|Main Page|Non existent page}}
</pre>
returns the translation of [[Main Page]] in the same language as page [[Non existent page]], that is, the translation of [[Main Page]] in an unknown language:
 
{{Translation of|Main Page|Non existent page}}


</noinclude>
</noinclude>

Revision as of 17:17, 19 April 2011

{{#if:

 | {{#if: {{#ask: [[Has language::{{#ask:Translation of|?Has language=}}]]
                  [[Translated from::{{{1}}}]]
          }}
     |    {{#ask: [[Has language::{{#ask:Translation of|?Has language=}}]]
                  [[Translated from::{{{1}}}]]
          }} 
     | {{{1}}}
   }}

}} Template Translation of returns the translation of page X in the same language as the language of page Y, if it exists. If no such translation exists, it returns page X itself.

Use

{{Translation of|X|Y}}

Examples

1. Translation exists

{{Translation of|Main Page|CC Wiki:De:Übersetzen}}

returns the translation of Main Page in the same language as page CC Wiki:De:Übersetzen, that is, the translation of Main Page in language De:

{{#if:Main Page

 | {{#if: {{#ask: [[Has language::{{#ask:CC Wiki:De:Übersetzen|?Has language=}}]]
                  Translated from::Main Page
          }}
     |    {{#ask: [[Has language::{{#ask:CC Wiki:De:Übersetzen|?Has language=}}]]
                  Translated from::Main Page
          }} 
     | Main Page
   }}

}}

2. Translation does not exist

{{Translation of|Main Page|Hr:Odabir licence}}

returns the translation of Main Page in the same language as page Hr:Odabir licence, that is, the translation of Main Page in language Hr (at the time of writing this translation did not exist):

{{#if:Main Page

 | {{#if: {{#ask: [[Has language::{{#ask:Hr:Odabir licence|?Has language=}}]]
                  Translated from::Main Page
          }}
     |    {{#ask: [[Has language::{{#ask:Hr:Odabir licence|?Has language=}}]]
                  Translated from::Main Page
          }} 
     | Main Page
   }}

}}

3. Language does not exist

{{Translation of|Main Page|Non existent page}}

returns the translation of Main Page in the same language as page Non existent page, that is, the translation of Main Page in an unknown language:

{{#if:Main Page

 | {{#if: {{#ask: [[Has language::{{#ask:Non existent page|?Has language=}}]]
                  Translated from::Main Page
          }}
     |    {{#ask: [[Has language::{{#ask:Non existent page|?Has language=}}]]
                  Translated from::Main Page
          }} 
     | Main Page
   }}

}}