Difference between revisions of "Template:Translate-link"
From Dragon Age Toolset Wiki
| Line 23: | Line 23: | ||
{{#ifeq: {{#titleparts:{{PAGENAME}}|1|2}} | {{#language:{{#titleparts:{{PAGENAME}}|1|2}}}} | {{#ifeq: {{#titleparts:{{PAGENAME}}|1|2}} | {{#language:{{#titleparts:{{PAGENAME}}|1|2}}}} | ||
<!-- If the language of the current page could not be extracted --> | <!-- If the language of the current page could not be extracted --> | ||
| − | | | + | | |
<!-- Create a link to original page and print error mesage --> | <!-- Create a link to original page and print error mesage --> | ||
[[{{{1}}}|Translate-link: <span style="color:#CC2200">GETTING_LANGUAGE_ERROR</span>]] | [[{{{1}}}|Translate-link: <span style="color:#CC2200">GETTING_LANGUAGE_ERROR</span>]] | ||
<!-- If the language of the current page has been extracted --> | <!-- If the language of the current page has been extracted --> | ||
| − | | | + | | |
{{#ifexist: {{{1}}}/{{#titleparts:{{PAGENAME}}|1|2}} | {{#ifexist: {{{1}}}/{{#titleparts:{{PAGENAME}}|1|2}} | ||
<!-- If exist page has been translated into current language --> | <!-- If exist page has been translated into current language --> | ||
| − | | | + | |3 |
<!-- Create a link to translated page --> | <!-- Create a link to translated page --> | ||
{{#if: {{{2|}}} | {{#if: {{{2|}}} | ||
| Line 37: | Line 37: | ||
}} | }} | ||
<!-- If not exist page has been translated into current language --> | <!-- If not exist page has been translated into current language --> | ||
| − | | | + | |4 |
<!-- Create a link to translated and original page --> | <!-- Create a link to translated and original page --> | ||
{{#if: {{{2|}}} | {{#if: {{{2|}}} | ||
Revision as of 12:12, 8 November 2010
Description
Template allows you to quickly create links to translated page DA Builder Wiki using the language of the current page:
| Source code | Condition | Output |
|---|---|---|
{{Translate-link|Main Page}}
|
If the language of the current page could not be extracted | Translate-link: GETTING_LANGUAGE_ERROR |
| If the page translated into current language exists (i.e. this page in Russian) | Main Page | |
| If the page translated into current language does not exist (i.e. this page in Russian) | Main Page (en) | |
{{Translate-link|Main Page|Other name}}
|
If the language of the current page could not be extracted | Translate-link: GETTING_LANGUAGE_ERROR |
| If the page translated into current language exists (i.e. this page in Russian) | Other name | |
| If the page translated into current language does not exist (i.e. this page in Russian) | Other name (en) | |
{{Translate-link|Main Page||ru}}{{Translate-link|Main Page|3=ru}}
|
If the language of the current page could not be extracted | See below ↓ |
| If the page translated into current language exists (i.e. this page in Russian) | Main Page | |
| If the page translated into current language does not exist (i.e. this page in Russian) | Main Page (en) | |
{{Translate-link|Main Page|Other name|ru}}
|
If the language of the current page could not be extracted | See below ↓ |
| If the page translated into current language exists (i.e. this page in Russian) | Other name | |
| If the page translated into current language does not exist (i.e. this page in Russian) | Other name (en) |
Note
This template has a short version ulink.