Template:LinkLang: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
< | <noinclude> | ||
This template can be used to create links that automatically point to the localized version of an article, if it exists, or to the original article otherwise. | |||
* First parameter: target page (in English) | |||
* Second parameter (optional): Translated link text to be displayed. | |||
==Examples== | |||
* In the [[Main Page]], you'll find '''<nowiki>{{LinkLang|Get involved}}</nowiki>'''. When this code is copied to a new translated version of that page, (for instance, in Spanish), it automatically creates this code: ''<nowiki>[[Get involved</nowiki>'''/es'''<nowiki>]]</nowiki>'' | |||
* In the [[Main Page/no|Norwegian version]] of the main page, you'll find '''<nowiki>{{LinkLang|Get involved|Involver deg}}</nowiki>''', which creates this code: ''<nowiki>[[Get involved</nowiki>'''/no'''<nowiki>|Involver deg]]</nowiki>'' | |||
[[Category: Translation]] | [[Category: Translation]] | ||
</noinclude> | </noinclude><includeonly>[[{{{1}}}{{#if: {{SUBPAGENAME}}|{{#ifexist:{{{1}}}/{{SUBPAGENAME}}|/{{SUBPAGENAME}}|}}|}}|{{#if: {{{2|}}}|{{{2}}}|{{{1}}}}}]]</includeonly> |
Revision as of 16:46, 7 May 2011
This template can be used to create links that automatically point to the localized version of an article, if it exists, or to the original article otherwise.
- First parameter: target page (in English)
- Second parameter (optional): Translated link text to be displayed.
Examples
- In the Main Page, you'll find {{LinkLang|Get involved}}. When this code is copied to a new translated version of that page, (for instance, in Spanish), it automatically creates this code: [[Get involved/es]]
- In the Norwegian version of the main page, you'll find {{LinkLang|Get involved|Involver deg}}, which creates this code: [[Get involved/no|Involver deg]]