Template:Link/documentation

This template generates a link to an entry in a given language. It links to a specific language-section on the target page, and applies language-specific formatting. It can also show a number of annotations after the linked term.

There are several linking templates:
 * (shortcut ). Use this template in sections that list entries, such as “Synonyms”, “Related terms”, and “Descendants”, or in running text when a word is being used . If a term is being mentioned (as in the use–mention distinction), use  instead.
 * (shortcut ). This template italicizes a word if the word is in a . Use this template to mention (as in the use–mention distinction) a term or phrase within running text (for example, in ===Etymology=== and ====Usage notes==== sections).
 * . Use this template in inflection tables and other templates that list multiple terms. It works the same as, but when it links to the same page it is placed on, the link turns bold rather than becoming a link. This mimics the MediaWiki software's behaviour when linking to the same page, but has the full language support of.
 * . Use this template in templates that mention multiple terms in running text. It displays like, but works the same as when linked to the current page.
 * . This template creates a link, but does not add any additional formatting or annotations. There is at the moment no consensus on whether it should be used in entries or not.

All of these templates create a link to a language's section of an entry, or to a language-specific sense id created by the template if the id parameter is used.

If the second parameter of, , , or contains a wikilink (  or  ), then this link will be transformed into a link to the language's section of the entry. For instance,  will be transformed into   and   will be transformed into , if the language code supplied to the template is.

The annotations – transliteration, translation, literal translation, and part of speech – are displayed by, , , or in parentheses after the link. does not support any of these annotations.

See also Style guide for a list of all the various styling templates with examples.

This template uses Module:links as a back-end, so it supports all the features of that module. Please see its documentation for more details.

Parameters
The template takes one required positional parameter and several optional parameters. Note that either the second or third positional parameter should be given, although technically neither is required.


 * 1
 * The language code (see Languages) for the language that the term is in. All Wiktionary language codes are supported, including those for constructed and reconstructed languages.


 * 2
 * The page name to be linked to. The template will automatically remove diacritics and punctuation from the page title, according to the  setting in Module:languages, but will keep them in the displayed text. To link to a reconstructed term, such as Proto-Germanic, add * in front of this parameter. Unsupported titles (see Special:PrefixIndex/Unsupported titles) can be linked to, by adding the displayed title, without the   prefix: for instance,  &rarr;  links to Unsupported titles/Colon. This feature is made possible by the list  found at Module:links/unsupported titles. To add new unsupported titles, follow the directions in the module.


 * 3
 * Alternate text to display as the link title, if different from the page name. Please do not use this only for adding diacritics or punctuation to the word, as the template can automatically remove these. See above.


 * t
 * A gloss or short translation of the word. The parameters 4 and gloss are deprecated for this purpose.


 * sc
 * The script code (see Scripts) for the script that the term is written in. When no code is given, the template will try to detect the script based on the characters in the term and the scripts in the language's data table (see ). In most cases, it will succeed. If it fails, the code  will be used.


 * tr
 * Transliteration for non-Latin-script words. When no transliteration is given, the template will try to add a default transliteration when possible. For certain languages, automated transliteration will override the value of this parameter. Use  if you don't want a transliteration to be automatically generated (you shouldn't really ever do this in an entry).


 * pos
 * A part of speech indication for the term.


 * g, g2, g3 and so on
 * Gender and number; see Module:gender and number for details.


 * lit
 * A literal translation for the term.


 * id
 * A sense id for the term, which links to anchors on the page set by the template.

Examples
Simple usage:
 * html
 * html

Showing alternative text:
 * html
 * went
 * went

With wikilinks in input:
 * html
 * html

Removal of diacritics:
 * html
 * html

Reconstructed words:
 * html
 * html

Translation:
 * or
 * html

Miscellaneous / with many options:
 * html
 * html

Wikicode
,, , or all add HTML tags in addition to creating a link. outputs the wikicode html, and outputs html. and do the same, except they don't create a link if the page being linked to is the same as the current page. This HTML is applied by Module:script utilities; for more, see Module:script utilities/documentation.

Customization
The outcome of Votes/2007-10/style for mentioned terms determined the default style for terms mentioned with the / template. The preliminary default for Latin-script (i.e. Roman script, not just Latin-language) terms and phrases is italics. Readers can easily toggle the output from italics to bold by selecting “Show other Latin (Roman) script mentions in bold” from WT:PREFS. Alternatively, or for more advanced customization, readers can add styles to their style sheets as described in WT:CUSTOM:


 * For plain format (e.g.: From mot + ...):
 * For bold format (e.g.: From mot + ...):
 * For italicized format (e.g.: From mot + ...):
 * For italicized format (e.g.: From mot + ...):
 * For italicized format (e.g.: From mot + ...):

Further, the default style of the subsequent English translation glosses is in double quotes (pending a vote to approve this template). Readers can easily change the output to single quotes by selecting “Show English glosses for mentioned terms in single quotes” from WT:PREFS.

Language-specific subtemplates
There are high performance versions of this template for several languages. All of them take two parameters: the word and the alternate text. Some may support transliteration also, but they should not support any other parameters for speed reasons. Using any of these subtemplates is sometimes necessary for pages that have many links, since they are faster. For normal use, there is no need for this, and the regular should be used instead.

TemplateData
{	"params": { "1": {			"label": "language code", "description": "The language code (see Wiktionary:Languages) for the language that the term is in. All languages are supported, including constructed and reconstructed ones.", "type": "string", "required": true, "suggested": true, "example": "en" },		"2": {			"type": "wiki-page-name", "label": "page name", "description": "The page name to be linked to.", "example": "house", "suggested": true },		"3": {			"label": "alternate text", "description": "(optional) Alternate text to display as the link title, if different from the page name.", "type": "string", "suggested": true },		"4": {			"aliases": [ "t", "gloss" ],			"label": "gloss", "description": "A gloss or short translation of the word. ", "type": "string", "suggested": true },		"lit": { "label": "literal translation", "description": "A literal translation for the term.", "type": "string" },		"id": { "label": "sense id", "description": " A sense id for the term, which links to anchors on the page set by the template.", "type": "string", "suggested": true },		"sc": { "label": "script code", "description": "(optional) The script code (see Scripts) for the script that the term is written in. The template can usually figure this out itself, so this is rarely needed. When no code is given, the template will try to detect the script based on the characters of the word, and if it fails to detect the script, the code  will be used.", "type": "string", "example": "Latn" },		"pos": { "label": "part of speech", "description": "A part of speech indication for the term", "type": "string", "example": "noun", "suggested": true },		"tr": { "label": "transliteration", "description": "Transliteration for non-Latin-script words. When no transliteration is given, the template will try to add a default transliteration when possible. For certain languages, automated transliteration will override the value of this parameter. Use  if you don't want a transliteration to be automatically generated (you shouldn't really ever do this in an entry).", "type": "string", "suggested": true },		"g": { "label": "gender and number", "description": "Gender and number; see Module:gender and number for details.", "type": "string", "suggested": true }	},	"description": "This template generates a link to an entry in a given language. It links to a specific language-section on the target page, and applies language-specific formatting. It can also show a number of annotations after the linked term.", "paramOrder": [ "1",		"2",		"3",		"4",		"sc", "tr", "pos", "g", "lit", "id" ],	"format": "inline" }

ca:Plantilla:e de:Vorlage:Verbindung fr:Modèle:lien tr:Şablon:zikret