Template:Localized link/doc

From Miranda NG
Jump to: navigation, search

This is a documentation subpage for Template:Localized link .
It contains usage information, categories and other content that is not part of the original template page.

shortcut: Template:Ll


This helper template can be used to link to translatable pages in the user's language. It uses the special page prefix Special:MyLanguage/, which checks if there is a translated version of a page in the user's language, and links to it if there is one, and links to a fallback language where available, or the default wiki language version (English in MediaWiki) if there isn't.

It should be used in translated pages, so that they link to the right page even if there is no translated page in that language.


This is the TemplateData documentation for this template used by VisualEditor and other tools.

TemplateData for Localized link

Link to translatable page in the user's language. It uses the special page prefix "Special:MyLanguage/".

Template parameters

This template has custom formatting.

Page name1

no description

Auto value
22Custom label

no description

Display title of linked page in the current page's language
Auto value

If 'nsp' parameter is not defined, as link text displays the full pagename (including namespace); otherwise — if 'nsp' parameter is defined by any value — link text displays the short pagename, without namespace.

Examples of simple usage

Use Becomes
{{ll|Communication}} Communication
{{ll|Communication|コミュニケーション}} コミュニケーション
{{ll|Project:About}} Project:AboutProject:About
{{ll|Project:About|nsp=0}} AboutProject:About

Usage in translatable pages

On pages prepared for translation with the Translate extension, this template may be used in three ways.

  1. Inside translation unit (inline with text), in case of custom label, better would be to use standard wikilink syntax and then embed link target into a <tvar|id>...</>.
    As example, instead of {{ll|Communication|About communication}}, better would be [[<tvar|comm>Special:MyLanguage/Communication</>|About communication]].
  2. Outside of translation unit or in some other cases, when you have custom label, better would be to mark for translation only label.
    As example, for some text {{ll|Communication|About communication}} some text , translation markup in translatable page will be:
    <translation>some text</translation> {{ll|Communication|<translation>About communication</translation>}} <translation>some text</translation>.
    This is useful for bulleted lists of links, e.g., in the "See also:" sections.
  3. If link text does not have to be different from the name of landing page, then better would be to embed the whole template call code into <tvar>.
    As example, instead of {{ll|Communication}} better would be <tvar|about-meta>{{ll|Communication}}</>.


Code taken from Mediawiki - Template:Localized_link

See also