Help:Interwiki linking on Wikimedia wikis: Difference between revisions
Content deleted Content added
No edit summary |
|||
(45 intermediate revisions by 20 users not shown) | |||
Line 1:
{{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]].
== Interwiki linking from and within Wikimedia ==
Within [[m:Wikimedia|Wikimedia]], for the purpose of
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.
=== 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 42 ⟶ 43:
| [[Wikisource]] (multilingual 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
|| <code>[[[[
--><code>[[[[metawikimedia:]]]]</code><br/><!--
--><code>[[[[metawikipedia:]]]]</code><br/><!--
--><code>[[[[m:|<span title="meta:">meta:</span>]]]]</code>
| <code>[[[[m:]]]]</code>
|-
| [[m:Wikimedia Incubator|Wikimedia Incubator]]
| <code>[[[[incubator:]]]]</code>
|
|-
| [[m:Strategy/Wikimedia movement/2010-2015|Wikimedia Strategic Planning]]
| <code>[[[[strategy:]]]]</code>
|
|-
| [[MediaWiki|<b>M</b>edia<b>W</b>iki]]
| <code>[[[[mediawikiwiki:]]]]</code>
| <code>[[[[mw:]]]]</code>
Line 82 ⟶ 86:
| [[Bugzilla|MediaZilla / Bugzilla]]
| <code>[[[[mediazilla:]]]]</code><br /><code>[[[[bugzilla:]]]]</code>
|
|-
| [[m:Phabricator|
| <code>[[[[phabricator:]]]]</code>
| <code>[[[[phab:]]]]</code>
Line 90 ⟶ 94:
| [[m:Testwiki|Testwiki]]
| <code>[[[[testwiki:]]]]</code>
|
|-
| [[Wikidata|Wiki<b>d</b>ata]]
| <code>[[[[wikidata:]]]]</code>
| <code>[[[[d:]]]]</code>
|-
| [[Wikifunctions|Wiki<b>f</b>unctions]]
| <code>[[[[wikifunctions:]]]]</code>
| <code>[[[[f:]]]]</code>
|-
| [[wikitech:|Wikitech]]
| <code>[[[[wikitech:]]]]</code>
|
|-
| [[wikitech:Portal:
| <code>[[[[
|
|}
{| class="wikitable sortable" style="margin-bottom:0; display:inline-table;"
! International chapters !! Shortcut
|-
Line 119 ⟶ 126:
| Belgium
| <code>[[[[wmbe:]]]]</code>
|-
| Brazil
| <code>[[[[wmbr:]]]]</code>
|-
| Canada
Line 152 ⟶ 162:
| Italy
| <code>[[[[wmit:]]]]</code>
|-
| Netherlands
| <code>[[[[wmnl:]]]]</code>
|-
| North Macedonia
| <code>[[[[wmmk:]]]]</code>
|-
| Norway
Line 189 ⟶ 199:
| <code>[[[[wmuk:]]]]</code>
|}
* 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:]].
<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 />
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
The shortcuts
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 />
== Technical ==
A project's 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.
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.
=== 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>
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:
Line 274 ⟶ 275:
In short, if you want the links to always work in the same way, always use <code><nowiki>[[</nowiki>'''m:'''<nowiki>Example]]</nowiki></code> to link to anything on Meta-Wiki; always use <code><nowiki>[[</nowiki>'''w:en:'''<nowiki>Example]]</nowiki></code> to link to anything on English Wikipedia; always use <code><nowiki>[[</nowiki>'''q:de:'''<nowiki>Beispiel]]</nowiki></code> to link to anything on German Wikiquote.
=== 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:
Line 287 ⟶ 288:
Non-local interwiki links will still work if you type them in the search bar and choose "go".
== Interlanguage links ==
:''For a complete list of current languages and language codes, see: [[w:List of Wikipedias]]''
Line 305 ⟶ 299:
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 [[mw:Help:
Comparison:
Line 322 ⟶ 316:
* on fr: [[:de:Zug]], [[:en:Train]]
=== 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:
*
*
*
== 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]
*[[MeatBall:InterWiki]]
[[Category:
[[Category:Content and banner management]]
|