Template:IfTranslation
This template conditionally activate the first parameter if the current page is a translation, or the second if the current page is in the wiki language (i.e. English for this wiki).
Usage
edit{{ifTranslation|1|2}}
Parameters:
- any wikitext in the first parameter is used if the page is a translation (translated document)
- any wikitext in the second parameter is used if the page is not a translation (document in English)
Important note: this template is not exactly the opposite of {{ifNotTranslation}}. This present template doesn’t consider the "/en" subpage as a translation (it is triggered by the second parameter), but {{ifNotTranslation}} does consider the "/en" subpage as a translation (triggered by its second parameter).
Use case: To conditionally include a warning on actual translations, this present template is preferred (else the warning would also be display on the "/en" subpage).
This template is intended to be used with the pages translated with the Translate extension. For translations which are not using Translate, its behavious could be misleading – e.g. if used on Pobočky Wikimedia (unsynchronised Czech translation of Wikimedia chapters) the template will behave as if it was a page in English (not a translation), and if used on a page ending with "/en" it will behave as if it was a source document even if the page is a translation into English from another language.
Example
editIf there is the code {{ifTranslation|Warning: this page is a non-authoritative translation of {{BASEPAGENAME}}.}}
at the beginning of the page Wikidata:List of properties/all, then Wikidata:List of properties/all and Wikidata:List of properties/all/en will not be displayed the warning, but Wikidata:List of properties/all/fr will.
See also
edit- {{ifNotTranslation}}
The above documentation is transcluded from Template:IfTranslation/doc (edit | history). Editors can experiment in this template's sandbox (create | mirror) and testcases (create) page. Please add categories to the /doc subpage. Subpages of this template. |