Diferencia entre revisiones de «Plantilla:Interlanguage link/doc»
Template:Interlanguage link/doc>Mathglot (→Limitations: Add a new subsection for →Interactions with other templates: .) |
m (1 revision imported) |
(Sin diferencias)
|
Revisión actual - 00:24 28 ene 2024
This is a documentation subpage for Plantilla:Interlanguage link. It contains usage information, categories and other content that is not part of the original plantilla page. |
This template is used on many pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
This template should not be used in citation templates such as Citation Style 1 and Citation Style 2, because it includes markup that will pollute the COinS metadata they produce; see Wikipedia:COinS. |
Plantilla:Expensive Plantilla:Language templates
This template links conditionally to pages on non-English Wikipedias. If the specified article does not exist on the English Wikipedia, this template intentionally displays a red link to that anticipated but still-nonexistent article, followed by link(s) to the specified article(s) on the non-English Wikipedia(s), shown under the corresponding language code(s), in brackets. Hovering over a non-English link displays the name of the article on the non-English Wikipedia, as normal. Links to non-English Wikipedia articles are always blue; it is up to the editor to make sure they link to the intended article.
If the specified article exists (that is, after the anticipated article has been created) on the English Wikipedia, this template will only show the blue link to that article, and no longer to the non-English link(s).Plantilla:Efn
Because {{ill}} normally produces a working link along with a redlink, it is appropriate for use in hatnotes, in spite of the general advice to avoid redlinks in hatnotes.Plantilla:Efn
Please be aware Cewbot removes this template when it detects the target article has been created on English Wikipedia, converting {{ill}} links to regular (blue) links.Plantilla:Efn
Usage
There are several ways of using this template. It can produce links to one or more specific languages, Magnus Manske's Reasonator, or to the Wikidata table of languages.
The shortcut {{ill}} may be used.
A full list of language codes can be found at List of Wikipedias § Active editions.
Plantilla:As of, if there is a redirect for the term in English Wikipedia, both the redirected (blue) link and interlanguage link(s) are displayed. This is why "casa" appears as a bluelink in the example below.
Where there are multiple interlanguage links readers may be confused about their purpose. The template {{interlanguage link info}} may be placed at the head of a page or section.
Link to one foreign language
To link to a foreign language article with the same title as the English Wikipedia, the parameters are:
{{ill|Article title|language code}}
{{ill|Hanning Schröder|de}}
produces: {{ Plantilla:PAGENAMETDOC|Hanning Schröder|de}} (the English article exists),
whereas
{{ill|Richard J. Youle|de}}
produces: {{ Plantilla:PAGENAMETDOC|Richard J. Youle|de}} (as of June 2022, no English article exists)
To link to a foreign language article with a different title, the parameters are:
{{ill|English article title|language code|Title in foreign language}}
{{ill|Hooglede town hall|nl|Gemeentehuis van Hooglede}}
produces: {{ Plantilla:PAGENAMETDOC|Hooglede town hall|nl|Gemeentehuis van Hooglede}}
Link to multiple languages
To link to multiple languages with the same title as the English language page, the titles of the page are not necessary; the parameters are:
Plantilla:((ill|English article title|language 1 code||language 2 code||...}}
- for example
{{ill|casa|es||it||ro||de|haus}}
produces: {{ Plantilla:PAGENAMETDOC|casa|es||it||ro||de|haus}}
Note: As of February 2016, casa above is a redirect. Redirects appear as blue links even while foreign-language links are still shown.
To link to multiple language articles, the parameters are:
{{ill|English article title|language 1 code|Title in language 1|language 2 code|Title in language 2|...}}
- for example
{{ill|Olena Chaplynska|uk|Олена Чаплинська|ru|Чаплинская, Гелена|ja|モトローナ・チャプリーンシカ}}
produces: {{ Plantilla:PAGENAMETDOC|Olena Chaplynska|uk|Олена Чаплинська|ru|Чаплинская, Гелена|ja|モトローナ・チャプリーンシカ}}
Modifying the display
Displaying different text
To create a piped link (text displayed that is different from the title of the page to which the text links), use the |lt=
parameter (which stands for "link text"). This is useful if disambiguation is necessary, for example to hide the (botanist) in Charles Darwin (botanist):
{{ill|Charles Darwin (botanist)|lt=Charles Darwin|fr|Charles Darwin|de|Charles Darwin|es|Charles Darwin}}
produces: {{ Plantilla:PAGENAMETDOC|Charles Darwin (botanist)|lt=Charles Darwin|fr|Charles Darwin|de|Charles Darwin|es|Charles Darwin}}
Do not use {{!}} to create piped links, as doing so will prevent the foreign language links from disappearing if an English article is created:
Plantilla:!xt is not equivalent to Plantilla:Xt.
Forcing links
To display the interlanguage links even if the English Wikipedia article exists, add any of the values 1
, y
, yes
or force
for the parameter |display=
or its alias, |preserve=
.Plantilla:Efn
Input | Output |
---|---|
{{ill|Joke|fr|Blague|hu|Vicc|de|Witz}} |
{{ Plantilla:PAGENAMETDOC|Joke|fr|Blague|hu|Vicc|de|Witz}} |
{{ill|Joke|fr|Blague|hu|Vicc|de|Witz|display=1}} |
{{ Plantilla:PAGENAMETDOC|Joke|fr|Blague|hu|Vicc|de|Witz|display=1}} |
This feature should not be used in articles under most circumstances. However, in pages that are primarily lists of pages that link to the same language, it might be desirable all links on a page should link to other languages whether or not an English page exists. This feature can also be used as a work-around to eliminate expensive parser function calls.
Note: As of February 2016, redirects appear as blue links even while foreign-language links are still shown (i.e. you do not need to force-show them).
Remove bold formatting from links
Usually the display of the Interlanguage or Wikidata or the Reasonator (the "appended link") are in normal font, but if the appended link is for example in a title line of table, then along with the rest of the line the appended link will be bold. In such circumstances the appended link can be set to display unbolded by adding any value for the parameter |nobold=
.
Input | Output |
---|---|
'''{{ill|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin}}''' |
{{ Plantilla:PAGENAMETDOC|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin}} |
'''{{ill|nobold=1|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin}}''' |
{{ Plantilla:PAGENAMETDOC|nobold=1|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin}} |
Italics and quotation marks
If the linked material should be in italics (e.g., it is a major work such as a film title), use |italic=y
(or |italic=yes
, etc.) to generate italic markup around the link but not around the square-bracketed inter-language links.{{ill|Un papillon sur l'épaule|fr|italic=y}}
produces: Un papillon sur l'épaule
If the linked material should have quotation marks around it (e.g., it is a minor work such as a song title), use |quote=y
(or |quote=yes
, etc.) to generate them around the link, but not around the square-bracketed inter-language links, and not themselves part of the link. This only does double quotation marks: {{ill|Maman ne le sait pas|fr|quote=y}}
produces: "Maman ne le sait pas"
If both are used, quotation marks will appear around an italicized title, without italicizing the quotation marks.
Punctuation before language links
If punctuation such as a comma or period/full stop follows the expression, you may wish to display the punctuation before the interlanguage link(s), especially if combining it with superscript display. So, rather than have:
- ...the French concept of freedom of instruction [fr].
which awkwardly displays the sentence-final punctuation after the French link, you can display it before:
- ...the French concept of freedom of instruction. [fr]
The second example above is achieved simply by borrowing the |lt=
parameter, and including the punctuation in it, like this:
{{ill|freedom of instruction|fr|Liberté d'enseignement|lt=freedom of instruction.|v=sup}}
Vertical alignment
The vertical alignment of the interlanguage/Wikidata/Reasonator links can be altered by adding:
vertical-align=sup
to place the links in superscriptvertical-align=sub
to place the links in subscript
The parameter aliases |valign=
or |v=
may be used instead.
Input | Output |
---|---|
{{ill|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin|vertical-align=sup}} |
{{ Plantilla:PAGENAMETDOC|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin|vertical-align=sup}} |
{{ill|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin|valign=sub}} |
{{ Plantilla:PAGENAMETDOC|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin|valign=sub}} |
{{ill|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin|v=sup}} |
{{ Plantilla:PAGENAMETDOC|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin|v=sup}} |
Infobox font size
When this template is placed within elements that already use a smaller font size, such as infoboxes, the interlanguage link drops below 85% of the page's default font size. To prevent this and adhere to MOS:SMALLTEXT the value ib
can be used with the vertical alignment parameter: vertical-align=ib
(or v=ib
, etc.)
Input | Output |
---|---|
{{ill|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin|v=ib}} |
{{ Plantilla:PAGENAMETDOC|Charles Darwin (botanist)|fr|Charles Darwin|de|Charles Darwin|v=ib}} |
This feature should only be used when the template is placed within infoboxes or other elements that use a smaller font size.
Link to Reasonator and Wikidata
To link to the Wikidata table of languages in which the article is available, the parameters are:
{{ill|Article title in English Wikipedia|WD=Wikidata item code}}
{{ill|Jokery|WD=Q131138}}
produces: {{ Plantilla:PAGENAMETDOC|Jokery|WD=Q131138}}
All links to other Wikipedias are ignored if |WD=
is present.
To link to Reasonator, add any value for the parameter |reasonator=
. If a Wikidata item is linked, then the Reasonator link goes to the page for that item; if not, then a search is performed on Reasonator for that item.
Input | Output |
---|---|
{{ill|Jokery|WD=Q131138|reasonator=1}} |
{{ Plantilla:PAGENAMETDOC|Jokery|WD=Q131138|reasonator=1}} |
{{ill|Jokery|reasonator=1}} |
{{ Plantilla:PAGENAMETDOC|Jokery|reasonator=1}} |
To display Wikidata link as "d", add any value for the parameter |short=
or its alias, |s=
:
{{ill|Jokery|wd=Q131138|s=1|v=sup}}
produces: {{ Plantilla:PAGENAMETDOC|Jokery|wd=Q131138|s=1|v=sup}}
Automatic removal
If you create an {{interlanguage link}} and an English Wikipedia article is later created, this template will appear as a regular (blue) link as explained above. The underlying template, however, will eventually be edited automatically (it is one of the tasks assigned to bot Cewbot), removing the template and resulting in a regular (blue) link. While this is intended to save on the computational load, it does mean users will not again be directed to the foreign-language article if the article is later deleted as this information is lost. The link will become a red link. Use |preserve=
or |display=
to prevent automatic removal.Plantilla:Efn
Limitations
Non-existent foreign article
On Wikipedia, links to nonexistent pages normally show as red links. There is no way for this template, or any code on Wikipedia, to check whether an article on another language's Wikipedia exists. Links to all foreign-language articles, including nonexistent foreign-language articles, show as blue links.
Interactions with other templates
This template may interact unfavorably with the {{lang}} template. For example, the following code will not work in article space (it works on talk and some other types of pages):
{{ill|Machsor Lipsiae|de|lt={{lang|he-LA|Machsor Lipsiae}}}}
→ [[Machsor Lipsiae|Plantilla:Lang]]
For an alternative way to code this that works in all namespaces, please see Template:Lang#Links. Mathglot (talk) 02:57, 27 January 2024 (UTC)
Examples
{{ill|TC Matic|af|TC Matic|nl|TC Matic|fr|TC Matic|es|TC Matic}}
produces: {{ Plantilla:PAGENAMETDOC|TC Matic|af|TC Matic|nl|TC Matic|fr|TC Matic|es|TC Matic}}, because TC Matic exists here{{ill|TC Matic (band)|af|TC Matic|nl|TC Matic|fr|TC Matic|es|TC Matic}}
produces: {{ Plantilla:PAGENAMETDOC|TC Matic (band)|af|TC Matic|nl|TC Matic|fr|TC Matic|es|TC Matic}}, because TC Matic (band) does not exist here{{ill|TC Matic (band)|af||nl||fr||es|}}
produces: {{ Plantilla:PAGENAMETDOC|TC Matic (band)|af||nl||fr||es|}} – although shown in blue the interwiki links won't work because they default to the title "TC Matic (band)" which is wrong{{ill|TC Matic (band)|lt=TC Matic|af|TC Matic|nl|TC Matic|fr|TC Matic|es|TC Matic}}
produces: {{ Plantilla:PAGENAMETDOC|TC Matic (band)|lt=TC Matic|af|TC Matic|nl|TC Matic|fr|TC Matic|es|TC Matic}} – the text "TC Matic" now redlinks to "TC Matic (band)"{{ill|TC Matic|lt=TC Matic (band)|af|TC Matic|nl|TC Matic|fr|TC Matic|es|TC Matic}}
produces: {{ Plantilla:PAGENAMETDOC|TC Matic|lt=TC Matic (band)|af|TC Matic|nl|TC Matic|fr|TC Matic|es|TC Matic}} – the text "TC Matic (band)" now links to "TC Matic" which exists
TemplateData
TemplateData for Interlanguage link
<templatedata> { "params": { "1": { "label": "Article name", "description": "Name of the English Wikipedia page, or suggested name if the page does not exist", "type": "wiki-page-name", "required": true, "suggested": true }, "2": { "label": "1st language code", "description": "Language code for the 1st page in another language", "type": "line", "suggested": true }, "3": { "label": "1st page", "description": "Title of the page in the 1st other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title", "suggested": true }, "4": { "label": "2nd language code", "description": "Language code for the 2nd page in another language", "type": "line" }, "5": { "label": "2nd page", "description": "Title of the page in the 2nd other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "6": { "label": "3rd language code", "description": "Language code for the 3rd page in another language", "type": "line" }, "7": { "label": "3rd page", "description": "Title of the page in the 3rd other language, if not the same as the English Wikipedia page", "default": "English Wikipedia article title", "type": "line" }, "8": { "label": "4th language code", "description": "Language code for the 4th page in another language", "type": "line" }, "9": { "label": "4th page", "description": "Title of the page in the 4th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "10": { "label": "5th language code", "description": "Language code for the 5th page in another language", "type": "line" }, "11": { "label": "5th page", "description": "Title of the page in the 5th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "12": { "label": "6th language code", "description": "Language code for the 6th page in another language", "type": "line" }, "13": { "label": "6th page", "description": "Title of the page in the 6th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "14": { "label": "7th language code", "description": "Language code for the 7th page in another language", "type": "line" }, "15": { "label": "7th page", "description": "Title of the page in the 7th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "16": { "label": "8th language code", "description": "Language code for the 8th page in another language", "type": "line" }, "17": { "label": "8th page", "description": "Title of the page in the 8th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "18": { "label": "9th language code", "description": "Language code for the 9th page in another language", "type": "line" }, "19": { "label": "9th page", "description": "Title of the page in the 9th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "20": { "label": "10th language code", "description": "Language code for the 10th page in another language", "type": "line" }, "21": { "label": "10th page", "description": "Title of the page in the 10th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "22": { "label": "11th language code", "description": "Language code for the 11th page in another language", "type": "line" }, "23": { "label": "11th page", "description": "Title of the page in the 11th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "24": { "label": "12th language code", "description": "Language code for the 12th page in another language", "type": "line" }, "25": { "label": "12th page", "description": "Title of the page in the 12th other language, if not the same as the English Wikipedia page", "type": "line", "default": "English Wikipedia article title" }, "lt": { "label": "Link text", "description": "Text displayed for the link to the English Wikipedia article, if not the same as the article title", "type": "line", "default": "English Wikipedia article title", "suggested": true }, "WD": { "label": "Wikidata item", "description": "Wikidata item of the article. Replaces links to pages in other languages", "aliases": [ "wd" ], "type": "line", "suggested": true }, "short": { "label": "Short Wikidata link text", "description": "If anything is set for this, Wikidata item link is displayed as 'd'", "aliases": [ "s" ], "type": "string" }, "reasonator": { "label": "Reasonator", "description": "If anything is set for this, there is a link to the Reasonator page for the Wikidata item (if there is a link to an item) or to a Reasonator search for the English Wikipedia article title (if there is no item link)", "type": "string" }, "nobold": { "label": "No bold (or italic)", "description": "Entering any value will force links to other-language pages, Wikidata and Reasonator and the link brackets to force non-bold and non-italic text. ", "type": "line", "example": "yes" }, "preserve": { "label": "Preserve", "description": "If anything is set for this, forces links to pages in other languages and projects to always display even if the English Wikipedia article exists", "aliases": [ "display" ], "type": "string" }, "italic": { "label": "Italicize", "description": "If anything is set for this, puts italicization markup around the text to be linked, without including the bracketed inter-language links within the italics", "aliases": [ "italics" ], "type": "string" }, "vertical-align": { "label": "Vertical alignment", "description": "Alters the position of language links from baseline, to superscript ('sup') or subscript ('sub') position. It can also prevent the font size of the language links from being reduced when used in infoboxes, by entering 'ib'.", "aliases": [ "valign", "v" ], "type": "line", "default": "baseline", "suggestedvalues": [ "sup", "sub", "ib" ] }, "quote": { "label": "Quote", "description": "If anything is set for this, puts double quotation marks around the text to be linked. The quotation marks won't be linked, and the bracketed inter-language links will be outside the quotation marks.", "aliases": [ "quotes" ], "type": "string", "suggestedvalues": [ "yes" ] } }, "description": "Link to other Wikipedias or Wikidata if an article in the English Wikipedia doesn't exist.", "paramOrder": [ "1", "lt", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "WD", "short", "reasonator", "preserve", "nobold", "italic", "vertical-align", "quote" ] } </templatedata>
Tracking categories
- Category:Interlanguage link template existing link (0)
- Category:Interlanguage link template forcing interwiki links (0)
Redirects
After a merge discussion, five other templates were merged into this template, and thus this template contains all of their features.
- {{Interlanguage link}}
- {{Interlanguage link forced}}
- {{Interlanguage link multi}}
- {{Interlanguage link Wikidata}}
- {{Link-interwiki}}
- {{Red Wikidata link}}
See also
- Plantilla:§l for general inline linking to other language Wikipedias
- {{Wikidata fallback link}} which provides some functionality similar to
|WD=
in this template - {{Further ill}}, a mashup of {{Further}} and {{ill}} for section header links
- User:Cobaltcigs/IllWill – a JavaScript that assists in finding interlanguage links