Template:Pg2

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

[[Special:MyLanguage/{{{1}}}|{{{1}}}]]

Template documentationview · edit · history · purge ]
This documentation is transcluded from Template:Pg2/doc.

Render localized link to page/file name

Usage

{{pg2 |1= |2= |anchor= }}

Formats a link to a page that may have been translated into the user's language. Uses Special:MyLanguage, which checks if there is a translated version of the page in the user's language, links to it if there is one, and links to the English version if not.

Examples:

  • {{pg2|pagename}} renders [[Special:MyLanguage/pagename|title]] where title is the translated pagename if present, or else the pagename
  • {{pg2|pagename|displayname}} renders [[Special:MyLanguage/pagename|displayname]]
  • {{pg2|pagename|displayname|anchor=ABC}} renders [[Special:MyLanguage/pagename#ABC|displayname]]

Template parameters

ParameterDescriptionDefaultStatus
1Target file or page namenonerequired
2Display nameTarget file or page nameoptional
anchorName of anchor (or section) in the target pagenoneoptional

Additional information

The template is intended to be used in the following namespaces: the Commons namespace

The template is intended to be used by the following user groups: all users

Relies on:

See also

  • {{Localized link}}: similar functionality, usually used in files or pages in namespaces other than Commons and Help. {{Pg2}} is used to link from pages in the Commons and Help namespaces to files or pages in other namespaces. It has the same syntax as {{Pg}} and is used by {{Pg}}.

Localization

This template is not intended to be localized.