Template:Trans: Difference between revisions

From Rosetta Code
Content added Content deleted
(typo)
(add optional `subpage` parameter)
Line 1: Line 1:
<includeonly><div class="examplemeta translation">'''Translation of''': [[#{{{1}}}|{{{1}}}]]{{#if:{{{2|}}}|&nbsp;&ndash;&nbsp;{{{2}}} }}</div></includeonly><noinclude>
<includeonly><div class="examplemeta translation">'''Translation of''': {{#if:{{{subpage|}}}|[[../{{{1}}}|{{{1}}}]]|[[#{{{1}}}|{{{1}}}]]}}{{#if:{{{2|}}}|&nbsp;&ndash;&nbsp;{{{2}}} }}</div></includeonly><noinclude>


This template marks a programming example as a translation of another one on the same task page.
This template marks a programming example as a translation of another one on the same task page.
Line 13: Line 13:
; Second argument ''(optional):
; Second argument ''(optional):
: Summary of changes.
: Summary of changes.
; Named arguments ''(optional):
:{|
|-
| <code>subpage</code>&nbsp;&mdash;&nbsp; || Set to 1 if the examples for this task are on subpages (i.e. pages named ''Taskname/Langname''), so that the link can be adjusted accordingly.
|}


{| class="wikitable"
{| class="wikitable"
Line 22: Line 27:
| {{trans|Python}}
| {{trans|Python}}
|-
|-
| <tt><nowiki>{{trans|Python|without the extra credits part}}</nowiki></tt>
| <tt><nowiki>{{trans|Python|without the error handling}}</nowiki></tt>
| {{trans|Python|without the extra credits part}}
| {{trans|Python|without the extra credits part}}
|-
| <tt><nowiki>{{trans|Python|subpage=1}}</nowiki></tt>
| {{trans|Python}}
|}
|}



Revision as of 11:32, 27 August 2016


This template marks a programming example as a translation of another one on the same task page.

Purpose

Sometimes examples are translated directly from other examples by multi-lingual users. This is a template to help people see where examples came from when they were translated directly from other languages. Of course the idea of RC is that all of the examples on a page do exactly the same thing in the same way, but this is not always possible. Examples that differ in this way may still be able to be translated back and forth. Some examples need to use fundamentally different methods to do things where certain things aren't available in a language (GUIs, data structures, etc.) or languages aren't similar in a way that relates to the task. These examples probably cannot be translated between each other.

Usage

First argument
The other programming language, spelled exactly as its heading is spelled on the same task page. This link will take them to that example.
Second argument (optional):
Summary of changes.
Named arguments (optional):
subpage —  Set to 1 if the examples for this task are on subpages (i.e. pages named Taskname/Langname), so that the link can be adjusted accordingly.
Example Renders as
{{trans|Python}}
Translation of: Python
{{trans|Python|without the error handling}}
Translation of: Python – without the extra credits part
{{trans|Python|subpage=1}}
Translation of: Python

Related templates

If the examples of the given task are on subpages (i.e. pages named Taskname/Langname) then use Template:Trans subpage instead.



This is a template. There are many others. See Category:RCTemplates for a complete list of templates.