Jump to content
Toggle menu
  • 8 articles
  • 75 files
  • 7 users
  • 37.8K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Template:Localized link/doc: Difference between revisions

Template page
m T:LL
duplicated argument
 
(8 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{shortcut|T:LL|T:LocL}}
<!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata -->
{{Documentation subpage}}
{{ifsandbox
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
|{{tsh|ll{{\s}}}}
|{{tsh|ll{{\s}}|LL|locl|LocL}}
}}
{{TemplateBox
  |1        = 1
  |1label-en= target
  |1label-de= Ziel
  |1d-en    = Target of the link
  |1d-de    = Ziel des Links
  |1type    = string/wiki-page-name
  |1def    = <!-- default value for the parameter -->
  |1stat    = required


== Purpose ==
  |2        = 2
This template can be used to link to [[Special:LanguageStats|translatable pages]] in the user's language. It uses the special page [[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 the English version if there isn't.
  |2label-en= link text
  |2label-de= Linktext
  |2d-en    = The displayed text of the link. If empty, the template tries to use the translated title of the target page in the user’s language, else it shows the target title.
  |2d-de    = Der angezeigte Text des Links. Wenn leer, versucht die Vorlage den übersetzten Titel der Zielseite zu verwenden, anderenfalls zeigt es den nicht übersetzten Titel der Zielseite an.
  |2type    = string/line
  |2def    =  
  |2stat    = optional
 
  |name              = Localized link
  |desc-en            = This template can be used to link to [[Special:LanguageStats|translatable pages]] in the user’s language. It uses the special page [[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 the English version if there isn’t.


It may be used in translated pages, so that they link to the right page even if there is no translated page in that language.
It may be used in translated pages, so that they link to the right page even if there is no translated page in that language.
  |desc-de            = Diese Vorlage kann verwendet werden, um zu einer [[Special:LanguageStats|übersetzbaren Seite]] in der Sprache des Benutzers zu verlinken. Es verwendet die Spezialseite [[Special:MyLanguage]], die prüft, ob es eine übersetzte Version der Seite in der Sprache des Benutzers gibt und zu dieser verlinkt. Wenn keine solche vorhanden ist, verlinkt sie zu englischsprachigen Version.


== Usage ==
Sie kann in übersetzten Seiten verwendet werden, so dass sie zu richtigen Seite verlinken, wenn es keine übersetzte Seite in dieser Sprache gibt.
It is used in the same way normal wikilinks are used: One parameter to use the same link text as the page name, two parameters for different page name and link text.
    |desc-td-en      = This template can be used to link to translatable pages in the user’s language. It uses the special page 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 the English version if there isn’t. It may be used in translated pages, so that they link to the right page even if there is no translated page in that language.
 
    |desc-td-de      = Diese Vorlage kann verwendet werden, um auf übersetzbare Seiten in der Sprache des Benutzers zu verlinken. Sie nutzt die Spezialseite Special:MyLanguage, die prüft, ob es eine übersetzte Version einer Seite in der Sprache des Benutzers gibt, und verlinkt diese, falls vorhanden, und ansonsten auf die englische Version. Sie kann in übersetzten Seiten verwendet werden, damit diese auch dann auf die richtige Seite verlinken, wenn es keine übersetzte Seite in dieser Sprache gibt.
=== Examples ===
  |namespace          =  
{| class="wikitable"
  |usergroup          =
|-
  |placement          =
! Use
  |example            = <nowiki>Commons:Welcome}}<br>{{Localized link|Commons:Welcome|关于</nowiki>
! Becomes
  |example-value      = {{Localized link{{\sandbox}}|Commons:Welcome}}<br>{{Localized link{{\sandbox}}|Commons:Welcome|关于}}
|-
  |mustbesubst        =
| <tt><nowiki>{{Localized link|Commons:Welcome}}</nowiki></tt>
  |relieson          =
| {{Localized link|Commons:Welcome}}
  |usage-notes        =  
|-
  |shorthand          =  
| <tt><nowiki>{{Localized link|Commons:Welcome|关于}}</nowiki></tt>
  |setscats          =  
| {{Localized link|Commons:Welcome|关于}}</tt>
  |seealso            =  
|}
* {{tl|pg}} More suitable for Commons help pages. Similar functionality, but on non-English pages attempts to link first to a version of the target page in the current page language, then in the user’s preferred language, then in English as a last resort.
 
* [[Template:Localized link/messagedoc]] – should be used for message documentation in translatable pages that use this template.
== See also ==
* {{tl|Multilingual link}} Links to Wikipedia article in user's interface language.
*{{tl|pg}} More suitable for Commons help pages. Similar functionality, but on non-English pages attempts to link first to a version of the target page in the current page language, then in the user's preferred language, then in English as a last resort.
  |type              =
* [[Template:Localized link/messagedoc]] – should be used for message documentation in translatable pages that use this template.
  |i18n-method        = -
 
  |i18n-desc          =
<includeonly>
  |i18n-subpage      =
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, INSIDE INCLUDEONLY TAGS. -->
  |i18n-mediawiki-msg =
  |print              =
| useTemplateData = {{#ifeq:{{SUBPAGENAME}}|sandbox|TNT:localized link|only}}
}}
<includeonly>{{Sandbox other||
<!-- Categories below this line; interwikis at Wikidata -->
[[Category:Navigational templates for the translate extension|* {{PAGENAME}}]]
[[Category:Navigational templates for the translate extension|* {{PAGENAME}}]]
</includeonly>
}}</includeonly>

Latest revision as of 19:12, 12 July 2025

This template can be used to link to translatable pages in the user’s language. It uses the special page 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 the English version if there isn’t.

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

Usage

{{Localized link |1= |2= }}

Template parameters

<templatedata>JSON</templatedata> ./. {{TemplateBox}}
TemplateData

TemplateData is a way to store information about template parameters (the description of those and of the whole template) for both humans and machines. It is used by VisualEditor and possibly other tools like Upload Wizard.


Existing template documentation
At Wikimedia Commons, it is recommended to use {{TemplateBox}} with either ‎useTemplateData=1 or ‎useTemplateData=only on the ‎/doc subpage and transcluding it with {{Documentation}} into the template. ‎<nowiki>-tags can be wrapped around the arguments, if required, to avoid templates being expanded.

Newly created template documentation and imports
Another option, especially for imported templates, or for users with JSON experience, is placing raw ‎<templatedata>-tags into the Wikitext of the template, as described in various Wikipediae.


Wikipedia's help about TemplateDataCommons-specific information

This template can be used to link to translatable pages in the user’s language. It uses the special page 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 the English version if there isn’t. It may be used in translated pages, so that they link to the right page even if there is no translated page in that language.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
target1

Target of the link

Page namerequired
link text2

The displayed text of the link. If empty, the template tries to use the translated title of the target page in the user’s language, else it shows the target title.

Lineoptional

Additional information

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

The template is intended to be used by the following user groups: no user group specified

Example

{{Localized link|Commons:Welcome}}<br>{{Localized link|Commons:Welcome|关于}}

renders as:

See also

  • {{Pg}} More suitable for Commons help pages. Similar functionality, but on non-English pages attempts to link first to a version of the target page in the current page language, then in the user’s preferred language, then in English as a last resort.
  • Template:Localized link/messagedoc – should be used for message documentation in translatable pages that use this template.
  • {{Multilingual link}} Links to Wikipedia article in user's interface language.

Localization

This template is not intended to be localized.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.