Difference between revisions of "Manual:Template/Example/Translate"

[quality revision][quality revision]
(Created page with "To switch from an English page to its German subpage, you can use the following template.<syntaxhighlight lang="htm"> {{#if: {{{1|}}}| {{DISPLAYTITLE:{{{1}}} }} |}} <div> {{#s...")
 
m
To switch from an English page to its German subpage, you can use the following template.
                    {{#if: {{{1|}}}| {{DISPLAYTITLE:{{{1}}} }} |}}
<div><div>
{{#switch: {{SUBPAGENAME}}
|de=[[File:De-active.png|link=]] [[File:En.png|link={{NAMESPACE}}:{{BASEPAGENAME}}]]
|[[File:De.png|link={{ARTICLEPAGENAME}}/de]] [[File:En-active.png|link=]]
}}
</div>div>
<br<br /><br><br />

                
On the English main page and the German sub page, include the template reference with the main page name in source editing mode at the top of the pages:

{{Translate|Pagename_here}}

The page switch then inserts the switch using the language flags:

Screenshot: language flags within an article



Attachments

Discussions