Help:Interwiki linking on Wikimedia wikis: Difference between revisions

Content deleted Content added
 
(21 intermediate revisions by 6 users not shown)
Line 1:
{{H:h}}
{{languages}}
{{hatnote|For information not specific to Wikimedia wikis, see [[mw:Manual:Interwiki]] and [[mw:Help:Interwiki linking]]}}
 
By adding a prefix to another [[Wikimedia projects|project]], internal link style ("prefixed internal link style") can be used to [[Help:Link|link]] to a page of another project. A system of shorthand link labels are used to refer to different projects, in the context of interproject linking, as seen within the actual source text. For example, <code>en:</code> refers to the English Wikipedia. This is seen in <code><nowiki>[[:en:Apple]]</nowiki></code>, which produces [[:en:Apple]], a link to the English Wikipedia article on "Apple".
 
This is called "interwiki linking". The precise interwiki links used vary slightly for each project, and can be seen at [[Special:Interwiki]].
This is called [[w:en:InterWiki|interwiki]]. For each project, an [[m:Interwiki map|interwiki map]] (a list of target projects with their prefixes) is specified ([//svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/maintenance/interwiki.sql?view=markup example]). These target projects need not use MediaWiki and need not even be a wiki.
 
== 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.
 
Most of the time, interwiki links are handled by [[Wikidata]] instead, but the manual interwiki link syntax still works and is useful in edge cases.
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 ===
This list is incomplete. See [[Special:Interwiki]] for a full list of valid interwiki links.
<section begin=iwl-tables />
{| class="wikitable sortable" style="margin-bottom:0 ; margin-right:2em; display:inline-table;"
! Project !! Long form !! Shortcut
|-
| [[Wikipedia|<b>W</b>ikipedia]]
| <code>[[[[w:|wikipedia:]]]]</code>
| <code>[[[[w:]]]]</code>
|-
| [[Wiktionary|<b>Wikt</b>ionary]]
| <code>[[[[wiktionary:]]]]</code>
| <code>[[[[wikt:]]]]</code>
|-
| [[Wikinews|Wiki<b>n</b>ews]]
| <code>[[[[wikinews:]]]]</code>
| <code>[[[[n:]]]]</code>
|-
| [[Wikibooks|Wiki<b>b</b>ooks]]
| <code>[[[[wikibooks:]]]]</code>
| <code>[[[[b:]]]]</code>
|-
| [[Wikiquote|Wiki<b>q</b>uote]]
| <code>[[[[wikiquote:]]]]</code>
| <code>[[[[q:]]]]</code>
|-
| [[Wikisource|Wiki<b>s</b>ource]]
| <code>[[[[wikisource:]]]]</code>
| <code>[[[[s:]]]]</code>
Line 41 ⟶ 43:
| [[Wikisource]] (multilingual&nbsp;pages)
| <code>[[[[oldwikisource:]]]]</code>
|<code>[[[[s:mul:]]]]</code>
|
|-
| [[Wikispecies|Wiki<b>species</b>]]
| <code>[[[[wikispecies:]]]]</code>
| <code>[[[[species:]]]]</code>
|-
| [[Wikiversity|Wiki<b>v</b>ersity]]
| <code>[[[[wikiversity:]]]]</code>
| <code>[[[[v:]]]]</code>
|-
| [[Wikivoyage|Wiki<b>voy</b>age]]
| <code>[[[[wikivoyage:]]]]</code>
| <code>[[[[voy:]]]]</code>
|-
| [[Wikimedia Foundation|<b>W</b>iki<b>m</b>edia <b>F</b>oundation]]
| <code>[[[[wikimedia:]]]]</code><br /><code>[[[[foundation:]]]]</code>
| <code>[[[[wmf:]]]]</code>
|-
| [[Wikimedia Commons|Wikimedia <b>C</b>ommons]]
| <code>[[[[commons:]]]]</code>
| <code>[[[[c:]]]]</code>
|-
| [[m:Meta:About|Wikimedia Meta<b>M</b>eta-Wiki]]
|| <code>[[[[metawiki:]]]]</code><br/><!--
--><code>[[[[metawikimedia:]]]]</code><br/><!--
Line 78 ⟶ 80:
|
|-
| [[MediaWiki|<b>M</b>edia<b>W</b>iki]]
| <code>[[[[mediawikiwiki:]]]]</code>
| <code>[[[[mw:]]]]</code>
Line 86 ⟶ 88:
|
|-
| [[m:Phabricator|Phabricator<b>Phab</b>ricator]]
| <code>[[[[phabricator:]]]]</code>
| <code>[[[[phab:]]]]</code>
Line 94 ⟶ 96:
|
|-
| [[Wikidata|Wiki<b>d</b>ata]]
| <code>[[[[wikidata:]]]]</code>
| <code>[[[[d:]]]]</code>
|-
| [[Wikifunctions|Wiki<b>f</b>unctions]]
| <code>[[[[wikifunctions:]]]]</code>
| <code>[[[[f:]]]]</code>
Line 198 ⟶ 200:
|}
 
* Other current Wikimedia prefixes: [[betawikiversity:]] (shortform: [[v:mul:]]), [[download:]], [[dbdump:]], [[gerrit:]], [[mail:]], [[mailarchive:]], [[outreach:]], [[otrs:]], [[OTRSwiki:]], [[quality:]], [[spcom:]], [[ticket:]], [[tools:]], [[tswiki:]], [[svn:]], [[sulutil:]] [[rev:]], [[wmania:]]</span>, [[wm2016:]], [[wm2017:]].</span>
<section end=iwl-tables />
* See a complete list of current and old but still working prefixes for all Wikimedia wikis at the [[foundation:Special:SiteMatrix|Wikimedia SiteMatrix]].
 
<section begin=iwl-text />
Some of theThe '''long forms''' don'tare worksometimes overwritten asby expectednamespaces withinwith the same project;name. forFor example <tt><nowiki>[[meta:]]</nowiki></tt> doesn'tprefers workto onthe Meta, while <tt><nowiki>[[metawikipedia:]]</nowiki></tt> does.Project Thisnamespace dependsinstead on theMeta. configuration of the wiki and where the names are stored (see also next paragraph). The '''shortcuts''' should work everywhere. ''(That is the intention; currently (16-Jan-2007), it does not work on all projects.)''
 
The [[m:Interwiki map|interwiki map]] on Meta lists many prefixes, among others, <tt><nowiki>[[wikipedia:]]</nowiki></tt> for the English Wikipedia, working from any Wiki supporting the Meta interwiki map, not(except onlyfor fromWikipedias MediaWikithat wikis.use Someit prefixes work only withas a page,project for example: [[wikipediawikipedia:]] (failsnamespace) vs. [[wikipediawikipedia:Interwikimedia link]] (works). These prefixes are case insensitive.
<!-- 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 withhave different histories. Wikipedia, Wikiquote etc. point to the English versions via an entry in [[m:Interwiki map]], and are also included in [https://phabricator.wikimedia.org/source/mediawiki/browse/master/maintenance/interwiki.list 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:]]), and are hardcoded rather than part of [[interwiki map]].
 
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
api.php?action=query&meta=siteinfo&siprop=interwikimap
 
== 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]].
You can't use one project's namespace prefix in another project's codebase because it might match a namespace within that same project. For example, [[MediaWiki:Sidebar]] exists on MetaWiki, Wikibooks, and MediaWiki.
So, when you're linking to a page in that namespace, add the project prefix, like this: [[MetaWiki:MediaWiki:Sidebar]], [[Wikibooks:MediaWiki:Sidebar]], or [[Mediawikiwiki:MediaWiki:Sidebar]].
 
When dealing with pages whose title begins with the projects prefix but the page is internal, for example [[Wikibooks:What is Wikibooks?]], keep things consistent across projects by adding the projects prefix again. It becomes, [[Wikibooks:Wikibooks:What is Wikibooks?]].
 
In the first example the <code>Wikibooks:</code> prefix gets in the way of recognizing <code>Wikibooks:</code> as a namespace in Wikibooks. But in MetaWiki, adding <code>Wikibooks:</code> makes the link to be treated as an interwiki prefix rather than a namespace, this allows links to be redirected to another project.
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 [[mw:Help:Self link|self-link feature]] do not work on interwiki links.
 
=== Prefixes ===
Line 318 ⟶ 315:
* on en: [[:de:Zug]], [[:fr:Train]]
* on fr: [[:de:Zug]], [[:en: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>
* {{links-small|w|template|nlii}} - <nowiki>''[[{{{1}}}]]'' ([[:nl:{{{2|{{{1}}}}}}|nl]])</nowiki>
* {{links-small|w|template|nlis}} - <nowiki>([[:nl:{{{1|{{PAGENAME}}}}}|nl]])</nowiki>
* {{links-small|w|template|nlinl}} - <nowiki>{{{1}}} ([[:nl:{{{2|{{{1}}}}}}|nl]])</nowiki>
 
=== Interlanguage links in the wider sense ===
Line 338 ⟶ 321:
 
Possible reasons for using an "interlanguage link" in the page body include:
* controlControl over position
* controlControl over label
* theThe target contains an anchor
 
== See also ==
* [[mw:Help:Interwiki linking]]
* [[mw:Manual:Interwiki]]
* [[w:Help:Interwiki linking]]
* [[Help:Interlanguage link demo]]
* {{mlm|Sister projects||Wikimedia sister projects}}
* [[m:Templates for linking to sister projects]]
* {{mlm|Interwiki map||Wikimedia interwiki map}}
** [https://phabricator.wikimedia.org/diffusion/MW/browse/master/maintenance/interwiki.list Default interwiki prefixes]
* {{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:EditorHandbook handbookWikimedia-specific]]
[[Category:Content and banner management]]