Template:IfNotTranslation

From Wikidata
Jump to navigation Jump to search
Documentation icon Template documentation[view · edit · history · purge ]

This template conditionally activate the first parameter if the current page is the source document (hence not a translation), or the second if the current page is a translation subpage.

Usage

[edit]
{{ifNotTranslation|1|2}}

Parameters:

  1. any wikitext in the second parameter is used if the page is not a translation (source document)
  2. any wikitext in the first parameter is used if the page is a translation (any translation: "/en", "/zh", etc.)

Important note: this template is not exactly the opposite of {{ifTranslation}}. This present template do consider the "/en" subpage as a translation (it is triggered by the second parameter), but {{ifTranslation}} doesn’t considers the "/en" subpage as a translation (triggered by its second parameter).

Important use case: To conditionally include a category only in the source document, this present template is preferred (else the category would also contain the "/en" subpage). Note that {{langcat}} currently categorise the /en subpage in the same category than the source document.

Warning: 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 meta:Pobočky Wikimedia (unsynchronised Czech translation of meta: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

[edit]

If the code {{ifNotTranslation|[[Category:Wikidata]]}} is at the end of the page Wikidata:Introduction, then Wikidata:Introduction will be included in the category Wikipedia Zero, but nor Wikidata:Introduction/fr nor Wikidata:Introduction/en will be in the category.

See also

[edit]