Template:IfTranslation/doc: Difference between revisions
[[mw:]]>Pppery ({{high-use|7250}}) |
ManfredoDo (talk | contribs) m (1 revision imported: Template documentation pages) |
(No difference)
|
Latest revision as of 18:03, 12 November 2022
This is a documentation subpage for Template:IfTranslation. It contains usage information, categories and other content that is not part of the original Template page. |
This template is used on approximately 7,250 pages. To avoid large-scale disruption and unnecessary server load, any changes to this template should first be tested in its /sandbox or /testcases subpages or in your own user subpage. The tested changes can then be added to this page in one single edit. Please consider discussing any changes on the talk page before implementing them. |
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
{{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 m:Pobočky Wikimedia (unsynchronised Czech translation of m: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
If there is the code {{ifTranslation|Warning: this page is a non-authoritative translation of IfTranslation.}}
at the beginning of the page m:WMF Resolutions/FDC Approval Fall 2012, then m:WMF Resolutions/FDC Approval Fall 2012 and m:WMF Resolutions/FDC Approval Fall 2012/en will not be displayed the warning, but m:WMF Resolutions/FDC Approval Fall 2012/fr will.
See also
- {{ifNotTranslation}}