Help:Interwiki linking on Wikimedia wikis: Difference between revisions
Content deleted Content added
→Interwiki links versus external links: show what is actually rendered |
Rm translate tags per User talk:Baris6161TURK#Help namespace |
||
Line 1:
{{H:h}}
{{languages}}
By adding a prefix to another [[
This is called [[w:en:InterWiki|interwiki]]. For each project, an [[
== Interwiki linking from and within Wikimedia ==
Within [[m:Wikimedia|Wikimedia]], for the purpose of {{mlww|interlanguage links||interlanguage links}} (see below), the project families are Wikipedia, Wiktionary, Wikiquote, Wikibooks and Wikisource. Thus, this applies for a link like en:, de:, etc., from a Wikipedia to another one, from a Wiktionary to another one, from a Wikiquote to another one, from a Wikibooks to another one or from a Wikisource to another one.
The interlanguage link feature works on Wikimedia Commons and produces links to the Wikipedias. This is not reciprocal, a link from a Wikipedia to Commons is an in-page link.
=== Project titles and shortcuts ===
<section begin=iwl-tables />
{| class="wikitable sortable" style="margin-bottom:0 ; margin-right:2em; display:inline-table;"
! Project !! Long form !! Shortcut
|-
|
| <code>[[[[w:|wikipedia:]]]]</code>
| <code>[[[[w:]]]]</code>
|-
|
| <code>[[[[wiktionary:]]]]</code>
| <code>[[[[wikt:]]]]</code>
|-
|
| <code>[[[[wikinews:]]]]</code>
| <code>[[[[n:]]]]</code>
|-
|
| <code>[[[[wikibooks:]]]]</code>
| <code>[[[[b:]]]]</code>
|-
|
| <code>[[[[wikiquote:]]]]</code>
| <code>[[[[q:]]]]</code>
|-
|
| <code>[[[[wikisource:]]]]</code>
| <code>[[[[s:]]]]</code>
|-
|
| <code>[[[[oldwikisource:]]]]</code>
|
|-
|
| <code>[[[[wikispecies:]]]]</code>
| <code>[[[[species:]]]]</code>
|-
|
| <code>[[[[wikiversity:]]]]</code>
| <code>[[[[v:]]]]</code>
|-
|
| <code>[[[[wikivoyage:]]]]</code>
| <code>[[[[voy:]]]]</code>
|-
|
| <code>[[[[wikimedia:]]]]</code><br /><code>[[[[foundation:]]]]</code>
| <code>[[[[wmf:]]]]</code>
|-
|
| <code>[[[[commons:]]]]</code>
| <code>[[[[c:]]]]</code>
|-
| [[
|| <code>[[[[metawiki:]]]]</code><br/><!--
--><code>[[[[metawikimedia:]]]]</code><br/><!--
Line 75 ⟶ 70:
| <code>[[[[m:]]]]</code>
|-
|
| <code>[[[[incubator:]]]]</code>
|
|-
| [[
| <code>[[[[strategy:]]]]</code>
|
|-
|
| <code>[[[[mediawikiwiki:]]]]</code>
| <code>[[[[mw:]]]]</code>
|-
| [[
| <code>[[[[mediazilla:]]]]</code><br /><code>[[[[bugzilla:]]]]</code>
|
|-
|
| <code>[[[[phabricator:]]]]</code>
| <code>[[[[phab:]]]]</code>
|-
| [[m:Testwiki|Testwiki]]
| <code>[[[[testwiki:]]]]</code>
|
|-
|
| <code>[[[[wikidata:]]]]</code>
| <code>[[[[d:]]]]</code>
Line 112 ⟶ 107:
|}
{| class="wikitable sortable" style="margin-bottom:0; display:inline-table;"
!
|-
|
| <code>[[[[wmar:]]]]</code>
|-
|
| <code>[[[[wmau:]]]]</code>
|-
|
| <code>[[[[wmbd:]]]]</code>
|-
|
| <code>[[[[wmbe:]]]]</code>
|-
|
| <code>[[[[wmca:]]]]</code>
|-
|
| <code>[[[[wmcz:]]]]</code>
|-
|
| <code>[[[[wmdk:]]]]</code>
|-
|
| <code>[[[[wmde:]]]]</code>
|-
|
| <code>[[[[wmfi:]]]]</code>
|-
|
| <code>[[[[wmhk:]]]]</code>
|-
|
| <code>[[[[wmhu:]]]]</code>
|-
|
| <code>[[[[wmin:]]]]</code>
|-
|
| <code>[[[[wmid:]]]]</code>
|-
|
| <code>[[[[wmil:]]]]</code>
|-
|
| <code>[[[[wmit:]]]]</code>
|-
|
| <code>[[[[wmmk:]]]]</code>
|-
|
| <code>[[[[wmnl:]]]]</code>
|-
|
| <code>[[[[wmno:]]]]</code>
|-
|
| <code>[[[[wmpl:]]]]</code>
|-
|
| <code>[[[[wmru:]]]]</code>
|-
|
| <code>[[[[wmrs:]]]]</code>
|-
|
| <code>[[[[wmes:]]]]</code>
|-
|
| <code>[[[[wmse:]]]]</code>
|-
|
| <code>[[[[wmch:]]]]</code>
|-
|
| <code>[[[[wmtw:]]]]</code>
|-
|
| <code>[[[[wmua:]]]]</code>
|-
|
| <code>[[[[wmuk:]]]]</code>
|}
*
<section end=iwl-tables />
*
<section begin=iwl-text />
Some of the '''long forms''' don't work as expected within the same project; for example <tt><nowiki>[[meta:]]</nowiki></tt> doesn't work on Meta, while <tt><nowiki>[[metawikipedia:]]</nowiki></tt> does. This depends on the configuration of the wiki and where the names are stored (see also next paragraph). The '''shortcuts''' work everywhere. ''(That is the intention; currently (16-Jan-2007), it does not work on all projects.)''
The [[
<!-- This template needs fixing:
One-letter prefixes (as a live check on the table): {{for loop|call=If interwiki link show||a|b|c|d|e|f|g|h|i|j|k|l|m|n|o|p|q|r|s|t|u|v|w|x|y|z}}
-->
The shortcuts are just interwikis with different histories. Wikipedia, Wikiquote etc. point to the English versions and are also included in the standard MediaWiki interwiki table (IIRC); w, q, b, wikt etc. are used like interlanguage wikilinks to link to the sisterproject in the same language (so [[w:it:b:]] is equivalent to [[Wikibooks:it:]]).
Non-Wikimedia interwiki codes have a limitation, that they can only be used through a link. For example, the entry for "[[wikt:John|John]]" on Wiktionary, a Wikimedia project, can be accessed by <tt><nowiki>[[wikt:John]]</nowiki></tt> or http://meta.wikimedia.org/wiki/wikt:John. However, the latter method does not work for non-Wikimedia wikis. For example, the main page on the Mozilla Wiki can be accessed via <tt><nowiki>[[MozillaWiki:Main Page]]</nowiki></tt>, but http://meta.wikimedia.org/wiki/MozillaWiki:Main_Page results in an error. In these cases, Special:Search can be used (http://meta.wikimedia.org/wiki/Special:Search/MozillaWiki:Main_Page). You can see [[m:Special:Interwiki|the Interwiki special page]] for a list of "forward" and "non-forward" prefixes.
<section end=iwl-text />
=== Interwiki links on other sites ===
Other MediaWiki installations will support different interwiki prefixes.
You may be able to use the [[mw:API:Query_-_Meta#siteinfo_.2F_si|MediaWiki API]] to query for a site's available interwiki prefixes.
Try replacing the <tt>index.php?''stuff''</tt> on the end of an edit or history URL with
== Technical ==
A project's own namespace prefix cannot be reused as code for an external project. However, the prefix used for a target project may coincide with the prefix for a project namespace, within that project. As a result, to link to a page in that namespace, use the same prefix twice, for example: [[en:Wikisource:Wikisource:Scriptorium]].
For portability across projects, one may want to select a link code that leads to the same target from all projects, for example: [[MetaWikipedia:wikibooks:Main Page]]. The "superfluous" "MetaWikipedia:" prevents "wikibooks:" being interpreted as namespace prefix, when the code is used at wikibooks itself, while at Meta the "MetaWikipedia:" is ignored (it is not a namespace prefix and even at Meta itself, it is recognized as code for Meta). The codes above work from all projects; however, the [[Help:Link#Wikilinks|existence detection]] and the [[Help:Self link|self-link feature]] do not work on interwiki links.
=== Prefixes ===
Interwiki links can use prefixes for the '''project''' and/or for the '''language'''. Without the prefix, links are local, for pages in the same project and the same language. If only a language is given, they go to a page in the same (or similar) project for the specified language. If a language is given on a multilingual wiki, it will go to the Wikipedia of the given language:
<nowiki>[[:fr:]]</nowiki> [[:fr:]]
<nowiki>[[:os:]]</nowiki> [[:os:]]
If only the project is specified, they typically go to the specified project in the corresponding language of the source, see above. At most, two prefixes are needed for pages in any existing project and any supported language. If a project is given on a multilingual wiki, it will go to the English version of the project:
<nowiki>[[s:de:Hauptseite]]</nowiki> [[s:de:Hauptseite]]
<nowiki>[[b:en:Main page]]</nowiki>  [[b:en:Main page]]
<nowiki>[[n:en:Main page]]</nowiki>   [[n:en:Main page]]
If the language is different, specifying it before the project can also work. However, this is '''discouraged''', as it may not function as expected on some projects:
<nowiki>[[:de:q:Hauptseite]]</nowiki> [[:de:q:Hauptseite]] (not recommended)
<nowiki>[[:en:n:Main page]]</nowiki>  [[:en:n:Main page]] (not recommended)
More than two prefixes are generally unnecessary, the following examples should work everywhere:
<nowiki>[[m:Help:Help]]</nowiki> [[m:Help:Help]]
<nowiki>[[w:Interwiki]]</nowiki> [[w:Interwiki]]
Two prefixes can have unexpected effects, for example, from [[m:|Meta]], the following links end up on
different pages: <nowiki>[[m:en:About]]</nowiki>  [[m:en:About]]
<nowiki>[[:en:m:About]]</nowiki> [[:en:m:About]]
<nowiki>[[m:About]]</nowiki>     [[m:About]]
In the first case [[m:|Meta]] ignores the <code>m:</code>, because it is local and then, interprets
<code>en:</code> as <code>w:en:</code>, the prefix for the [[w:en:About|English Wikipedia]]. In the second case, the leading <code>en:</code> goes to the English Wikipedia, where the following <code>m:</code> goes straight back to [[m:About|Meta]].
In other words, multiple prefixes are evaluated left to right by the relevant Wikimedia servers (project and language). For projects without different languages, like [[m:|Meta]] (because Meta is
multilingual by itself), language prefixes can be handled as shorthands for <code>w:</code> plus the specified language:
<nowiki>[[:pl:2006]]</nowiki>   [[:pl:2006]]
<nowiki>[[w:pl:2006]]</nowiki>  [[w:pl:2006]]
<nowiki>[[:pl:w:2006]]</nowiki> [[:pl:w:2006]]
From [[m:|Meta]], the first two links both arrive at the Polish 2006 page. The third arrives at the English [[w:|Wikipedia]], because that's how the server selected by <code>:pl:</code> interprets the second prefix <code>w:</code>.
For a portable link on that server, it would be a bad idea to use <code>w:</code>, but <code>:pl:</code> does the trick. To test that effect from [[m:|Meta]], the following links should go to the same page:
<nowiki>[[:ja:2006]]</nowiki>    [[:ja:2006]]
<nowiki>[[:ja:ja:2006]]</nowiki> [[:ja:ja:2006]]
A universal interwiki link, that is, one that works no matter from which Wikimedia wiki, can be written
=== Portable links ===
In short, if you want the links to always work in the same way, always use
=== Non-local interwikis ===
Technically, an interwiki [[mw:Manual:Interwiki table|defined as local]] is one which always "forwards" to the destination: such interwikis can always be concatenated. The examples above work because all those interwikis are local in all those wikis. Interwikis which are not local in the wiki where they're concatenated or used directly won't work.
The following works:
<nowiki>[[MeatBall:AssumeGoodFaith]]</nowiki>    [[MeatBall:AssumeGoodFaith]]
All these don't ("Bad title" error):
<nowiki>[[w:MeatBall:AssumeGoodFaith]]</nowiki>    [[w:MeatBall:AssumeGoodFaith]]
<nowiki>https://meta.wikimedia.org/wiki/MeatBall:AssumeGoodFaith</nowiki>    https://meta.wikimedia.org/wiki/MeatBall:AssumeGoodFaith
<nowiki>https://en.wikipedia.org/wiki/MeatBall:AssumeGoodFaith</nowiki>    https://en.wikipedia.org/wiki/MeatBall:AssumeGoodFaith
Non-local interwiki links will still work if you type them in the search bar and choose "go".
==
In [[w:en:
Note that
''From Wikimedia projects'', use <tt>[[wikiasite:psychology]]</tt>, giving [[wikiasite:psychology]]; <tt>[[wikia:trains:locomotive]]</tt>, giving [[wikia:trains:locomotive]]; or for the central wikia, [[centralwikia:About Wikia]]. ''Don't confuse this with [[wikia:c:Community Central]] and other pages on the Community Central wikia.''<!-- {{lcfirst:Wikia}} is the official name for Wikis hosted by {{ucfirst:Wikia}} -->
== Interlanguage links ==
:''For a complete list of current languages and language codes, see: [[w:List of Wikipedias]]''
For a multilingual family of similar projects, with one project per language, a system for '''interlanguage linking''' can be set up, setting [[mw:Manual:$wgInterwikiMagic|$wgInterwikiMagic]] to true and [[mw:Manual:$wgHideInterlanguageLinks|$wgHideInterlanguageLinks]] to false. If this project is in a family for which this applies, [[Help:Interlanguage link demo]] may demonstrate what is explained below (this depends on whether the same language codes are used).
An interwiki link within the family is treated differently, unless it is on a talk page of any namespace. It appears at one or two edges of the webpage (left in Monobook, top and bottom in Classic).
Thus, an interlanguage link is mainly suitable for linking to the most closely ''corresponding'' page in another language. It is not suitable for multiple links of the same other language. See
The feature can also be used on an image description page, to link to the same or a similar image in a sister project. Other interwiki links to images require the prefixed colon.
Note that, if a page may be used as a [[
Comparison:
# <tt>[[:en:link]]</tt> or <tt>[[:category:name]]</tt> are ordinary links.
# <
# <tt>[[category:name]]</tt> without leading colon, adds a category to the page.
# <
# <tt><noinclude>[[category:name]]</noinclude></tt> limits it to the actual page.
# <
For projects like [[m:|Meta]], a missing leading colon has no effect, because Meta doesn't support interlanguage links. For [[w:|Wikipedia]] and similar projects, it is a major difference. The mutual order of interlanguage links is preserved, but otherwise the positions within the wikitext are immaterial, again the same rule as for categories. Usually they are put at the end. With section editing, they appear in the preview, if they are in the section being edited. A link to the project itself (hence, also a link to the page itself), even if referred to with the project prefix, appears in-page.
Suppose that we have pages
* on de: [[:en:Train]], [[:fr:Train]]
*
*
Thus, there is no possibility of simply copying each list, let alone of using a template, as can be done, if different languages share one project with or without separate namespaces. For further information, see:
* [[m:Template:H-langs:Interwiki linking]], used at the bottom of [[m:Help:Interwiki linking|this page on Meta]]
* [[wikisource:Template:InterLingvLigoj]]
* [[Template:Other languages/Meta:About|Template:About]]
=== In-page interlanguage links ===
To make an interlanguage link in-page, prefix a colon (e.g. <nowiki>[[:en:wiki|wiki]]</nowiki>). This can be useful to link to a page in another language, if no local version is available. For example, several templates for conveniently making such links would be:
* {{links-small|w|template|nli}} - <nowiki>[[:nl:{{{1}}}]] (in [[Dutch language|Dutch]])</nowiki>
* {{links-small|w|template|nlil}} - <nowiki>[[{{{1}}}]] ([[:nl:{{{2|{{{1}}}}}}|nl]])</nowiki>
Line 349 ⟶ 333:
* {{links-small|w|template|nlinl}} - <nowiki>{{{1}}} ([[:nl:{{{2|{{{1}}}}}}|nl]])</nowiki>
=== Interlanguage links in the wider sense ===
An interlanguage link in the wider sense includes a link to a corresponding page in another language, which, for the software, is a regular link, as opposed to one employing the special interlanguage link ''feature'' as described above. This can also be an internal link on a multilingual project, e.g. on Meta:
* [[Meta:Interlanguage links]]
Possible reasons for using an "interlanguage link" in the page body include:
* control over position
*
* the target contains an anchor
== Interwiki links versus external links ==
Disadvantages of interwiki links:
* The wikitext is less portable across wikis, because wikis do not always have an interwiki prefix for the same sites and even if they do, the prefixes may differ
* There is no feature to find interwiki links, while searching for an external link can be done with [[Special:Linksearch]] (if installed). This is due to the fact that, while there is an [[mw:Externallinks table|external links table]], there is no such thing for interwiki links. The [[mw:interwiki table|interwiki table]] only stores the interwiki prefixes with their targets as function of the parameter, not the instances of the links.
** There is the {{ll|iw=mw|API:iwbacklinks|nsp=0}} query API that returns the pages that use the requested interwiki prefix.
** Using the general text search, to search for interwiki links, is more work for the server and therefore, it may be slow, not up-to-date or in busy hours, disabled. See also: [[Help:What_links_here#Finding_external_links_to_a_page|Finding external links to a page]].
* They're misleading because the user has no indication that they're being taken to a different site.
Using templates like {{links-small|template|h:mlw}}, the advantages of interwiki links and external links are combined. When a page using this template, which is in this case used for links to the English Wikipedia, is copied to that site, a template with the same name is needed there too. Due to that template, {{links-small|w|template|h:mlw}}, which redirects to {{links-small|w|template|h:ml}}, the interwiki links are automatically converted to internal links. Hence, they provide existence detection and allow use of "What links here", as well as Linksearch.
Comparison:
* <nowiki>''[[imdbtitle:0389790|Bee Movie]]''</nowiki> gives ''[[imdbtitle:0389790|Bee Movie]]''
*
** [http://meta.wikimedia.org/w/index.php?title=Special%3ALinksearch&target=http%3A%2F%2Fwww.imdb.com%2Ftitle%2Ftt0389790 Linksearch] works for the latter only
The applicable CSS classes are "extiw" and "external text". The choice may be governed by this, either way, for uniformity or distinction. An interwiki link is easier to type by itself, but if one goes to the webpage anyways, before putting the link, copying the URL is very convenient. When a template is created, e.g. {{tiw|imdb title}}, the template can be made, such that it uses an interwiki link and a parameter, like "tt0389790" or "0389790", or that it uses an external link and a parameter like one of those or the full url, if that is more convenient.
== Interwiki links to the same wiki versus internal links ==
Disadvantages of interwiki links to the same wiki, compared to internal links:
* no existence detection
* "What links here" works for internal links only
* The interwiki link prefix for the same wiki should be supported otherwise it creates an invalid internal link.
Advantages of interwiki links to the same wiki, compared to internal links:
* better portability across wikis, provided that the same prefix applies and is not equal to a namespace name
When using templates like {{links-small|template|h:ml}}, the advantages of internal links, interwiki links and external links are combined, provided that a template with the same name and adapted content is present on the other site.
== See also ==
* [[mw:Help:Interwiki linking]]
* {{mlm|Sister projects||Wikimedia sister projects}}
*
* {{
** [
* {{mlww|InterWikimedia links||Interwikimedia link}} at [[Wikipedia]]
* [http://tools.wikimedia.de/~flacus/IWLC/index.php Wikipedia Interwiki-Link-Checker] (dead)
** [[de:Benutzer:Flacus/Wikipedia Interwiki-Link-Checker/en]] (with the Interwiki-Link-Checker, you can help to improve the internationalisation of Wikipedia)
*[[MeatBall:InterWiki]]
{{h:f|langs=|enname=Interwiki linking}}
[[Category:Editor handbook
|