Template:Trans: Difference between revisions

Added a new optional parameter to add a link to an old version
(remove mention of the now redundant "trans subpage" template)
(Added a new optional parameter to add a link to an old version)
 
(One intermediate revision by one other user not shown)
Line 1:
<includeonly><div class="examplemeta translation">'''Translation of''': {{#if:{{{version|}}}|[http://{{SERVERNAME}}/mw/index.php?oldid={{{version}}}#{{{1}}} {{{1}}} (old version)]|{{#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.
Line 12:
: 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, or other remarks about the translation.
; 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.
|-
| <code>version</code>&nbsp;&mdash;&nbsp; || Set to a version number if you want to link to an old version page
|}
 
Line 28 ⟶ 30:
|-
| <tt><nowiki>{{trans|Python|without the error handling}}</nowiki></tt>
| {{trans|Python|without the extraerror credits parthandling}}
|-
| <tt><nowiki>{{trans|Python|subpage=1}}</nowiki></tt>
| {{trans|Python}}
|-
| <tt><nowiki>{{trans|Haskell|version=256063}}</nowiki></tt>
| {{trans|Haskell|version=256063}}
|}