Help:Interwiki linking

From STIQ

Jump to: navigation, search
PD
Important note: When you edit this page, you agree to release your contribution into the public domain. If you don't want this or can't do this because of license restrictions, please don't edit. This page is one of the Public Domain Help Pages, which can be freely copied into fresh wiki installations and/or distributed with MediaWiki software; see Help:Contents for an overview of all pages.

Interwiki links are links to pages of other projects, using a prefixed internal link style.

Interwiki links make it possible, to link to pages of (e.g.) Wikipedia, Wikibooks, Wikinews etc. or to your wiki-project in different languages (see Manual:Wiki family).

A link like [[Wikipedia:Main Page]] will appear like this: Wikipedia:Main Page and redirect you to Wikipedia's Main Page. Or it would, if Wikipedia: or a similar prefix were one of the interwiki links that is turned on by default. Try [[MetaWikipedia:Main Page]] instead : MetaWikipedia:Main Page.

For setting up interwiki links, you might need to edit the database. If you don't want to, you can use Extension:Special page to work with the interwiki table.

Contents

Interwiki links to other projects

Default

Several Wikimedia-Projects (and others) are ready for interwiki linking by default, so you can use them without editing your database. However, the mother of all Wikimedia-projects — Wikipedia itself — is still missing, after all these years. It's a bit like the main roads in large cities around the world that go for generations without any street signs.

So here is how to add it...
(note: advanced mySQL users may prefer to use just a single command line: INSERT INTO interwiki SET iw_prefix='(the wiki name)', iw_url='http://(the adequate URL)/$1', iw_local=1, iw_trans=0 ; - instead of exporting and re-importing the whole table interwiki content... )

  • Export the database table 'interwiki' then add to the end of the table the following example...
  • ('en', 'http://en.wikipedia.org/wiki/$1', 1, 0);
  • Note: in the above code, the semicolon ';' as seen, MUST be at the end of the table. At the end of any other line within that table Only has ','.
  • Import the database table 'interwiki'
  • Next: Goto your site, create an article, with the following content.
  • [[en:Main_Page|]] will display a link of Main_page and when click on, will go to the url http://en.wikipedia.org/wiki/Main_Page

The following is general interwiki linking.

prefix direction usage example
commons http://commons.wikimedia.org/wiki/ [[commons:MediaWiki]]
mediazilla http://bugzilla.wikimedia.org/ [[mediazilla:1209]]
meta http://meta.wikimedia.org/wiki/ [[meta:Main Page]]
mw http://www.mediawiki.org/wiki/ [[mw:Help:Contents]]
wikibooks http://en.wikibooks.org/wiki/ [[wikibooks:Main Page]]
wikimedia http://wikimediafoundation.org/wiki/ [[wikimedia:Main Page]]
wikinews http://en.wikinews.org/wiki/ [[wikinews:Main Page]]
wikiquote http://en.wikiquote.org/wiki/ [[wikiquote:Main Page]]
wikisource http://en.wikisource.org/wiki/ [[wikisource:Main Page]]
wikispecies http://species.wikimedia.org/wiki/ [[wikispecies:Main Page]]
wiktionary http://en.wiktionary.org/wiki/ [[wiktionary:Main Page]]

Note: In some installations none of these is pre-installed. Try [[metawikipedia:Main Page]] in this case.

Adding more

As the Wikipedia isn't set up by default in version 1.9 and before, you might want to add it (and other projects of your need).

You have to edit your own database. Go to table interwiki and add a new line (usually done with phpMyAdmin):

  • iw_prefix: choose a prefix, which is used for interwiki linking, e.g. "wikipedia" for linking to Wikipedia
  • iw_url: enter the project's URL, e.g. http://en.wikipedia.org/wiki/$1 for Wikipedia. Don't forget the $1 as it is replaced with the article's name you are linking to ([[Wikipedia:Main Page]] links to http://en.wikipedia.org/wiki/Main_Page).

That won't work because you have to enter it as binary (bug?), So you have (or not) to add the url in a plain text file, then import it through phpmyadmin. this applies to SVN.

  • iw_local: if 1, your wiki will redirect even external links of the form iw_prefix:title, not only those from its own pages. you need this if you want to use the redirect functionality from outside your wiki or other wikis use your transwiki functions for nested transwiki links (like http://en.wikipedia.org/wiki/fr:Accueil)
  • iw_trans: "transwiki transclusion" - set to 1 if you want to use pages from the other wiki as templates. You will also need to set $wgEnableScaryTranscluding = true in your LocalSettings.php
Tip for wiki admins: Several help pages link to MediaWiki.org's Manual namespace. To make these links work on your local wiki, add an interwiki link with iw_prefix=manual and iw_url=http://www.mediawiki.org/wiki/Manual:$1

Interwiki links to other languages

Image:M-en-interwiki lang.png
Interwiki links to other languages

If you have installed a Wiki family, you can link from an article in English to an article in German (if you have a German project, too). You can set up MediaWiki, to show those links in the sidebar, just below the toolbox.

In your filesystem, there is a subfolder of your MediaWiki installation, called "languages". Go there and have a look at "Names.php" as it contains a list of known languages and their prefixes. E.g. you want to add your German project, search "Names.php" for "Deutsch" and note the prefix "de".

If you know the "right" prefix, edit your database by adding a new line to table interwiki:

  • iw_prefix: language-prefix (e.g. "de" for German), which is listed in "Names.php"
  • iw_url: URL to your wiki-project (e.g. http://de.your-wiki.org/index.php/$1)
  • iw_local: same as above "Adding More"
  • iw_trans: same as above "Adding More"


Now, you can link an article to the same in other languages. Adding [[de:Hauptseite]] on your english Main_Page will create a link "Deutsch" below the toolbox, which leads to the Main_Page of the German wiki (Hauptseite).

Note, that this link is shown in Sidebar's section, only, and not inside of the article. If you want to create a link inside of the text, you have to add a colon previous to the prefix: [[:de:Hauptseite]].

External links

MetaWiki: Help:Interwiki linking

>== Template == <onlyinclude><div class="LanguageLinks"> <table width="100%"> <tr valign="top" style="background: #EEF3E2"> <td style="width: 25px; padding-left: 0.5em;">Languages</td> <td style="width: 10px; white-space: nowrap; padding: 4px 1em 0 0.5em; border-right: 1px solid #aaaaaa;">Languages:&nbsp;</td><td style="padding: 1px 1em 0; background: #F6F9ED;"> English {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ar |  • {{#if: Help:Interwiki linking|العربية| العربية}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/br |  • {{#if: Help:Interwiki linking|Brezhoneg| Brezhoneg}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ca |  • {{#if: Help:Interwiki linking|Català| Català}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/cs |  • {{#if: Help:Interwiki linking|Česky| Česky}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/de |  • {{#if: Help:Interwiki linking|Deutsch| Deutsch}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/el |  • {{#if: Help:Interwiki linking|Ελληνικά| Ελληνικά}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/es |  • {{#if: Help:Interwiki linking|Español| Español}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/fa |  • {{#if: Help:Interwiki linking|فارسی| فارسی}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/fi |  • {{#if: Help:Interwiki linking|Suomi| Suomi}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/fr |  • {{#if: Help:Interwiki linking|Français| Français}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/he |  • {{#if: Help:Interwiki linking|עברית| עברית}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/hu |  • {{#if: Help:Interwiki linking|Magyar| Magyar}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/id |  • {{#if: Help:Interwiki linking|Bahasa Indonesia| Bahasa Indonesia}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/it |  • {{#if: Help:Interwiki linking|Italiano| Italiano}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ja |  • {{#if: Help:Interwiki linking|日本語| 日本語}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ko |  • {{#if: Help:Interwiki linking|한국어| 한국어}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/mr |  • {{#if: Help:Interwiki linking|मराठी| मराठी}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/nl |  • {{#if: Help:Interwiki linking|Nederlands| Nederlands}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/no |  • {{#if: Help:Interwiki linking|‪Norsk (bokmål)‬| ‪Norsk (bokmål)‬}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/oc |  • {{#if: Help:Interwiki linking|Occitan| Occitan}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/pl |  • {{#if: Help:Interwiki linking|Polski| Polski}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/pt |  • {{#if: Help:Interwiki linking|Português| Português}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ro |  • {{#if: Help:Interwiki linking|Română| Română}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/ru |  • {{#if: Help:Interwiki linking|Русский| Русский}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/sq |  • {{#if: Help:Interwiki linking|Shqip| Shqip}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/sr |  • {{#if: Help:Interwiki linking|Српски / Srpski| Српски / Srpski}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/sv |  • {{#if: Help:Interwiki linking|Svenska| Svenska}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/th |  • {{#if: Help:Interwiki linking|ไทย| ไทย}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/vi |  • {{#if: Help:Interwiki linking|Tiếng Việt| Tiếng Việt}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/yue |  • {{#if: Help:Interwiki linking|粵語| 粵語}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/zh |  • {{#if: Help:Interwiki linking|中文| 中文}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/zh-hans |  • {{#if: Help:Interwiki linking|‪中文(简体)‬| ‪中文(简体)‬}}|}} {{#ifexist: {{#if: Help:Interwiki linking | Help:Interwiki linking | {{#if: Help | Help:}}Interwiki linking}}/zh-hant |  • {{#if: Help:Interwiki linking|‪中文(繁體)‬| ‪中文(繁體)‬}}|}} </td></tr></table></div></onlyinclude>



Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page


CLICK HERE


Syntax

{{{Languages|PageName}}}
  • PageName (optional) - the name of the page to display language links for. If omitted then the English version of the current page is used. This parameter can normally be omitted, as it is only required if you want to link to a page other than the one you place the template on, which is very uncommon. If this parameter is used on a sub-page make sure you supply the root name, not the full page name (e.g. on MediaWiki/fr you would need to use {{{Languages|MediaWiki}}} and not {{{Languages|MediaWiki/fr}}}).

Usage

The template should only be placed on pages that exist in more than one language, and it should be placed in the same location on each translation of the page.

The English version of a page is always the main version, with all other languages as sub-pages, named using the appropriate language code (see below).

For example, on the Main Page you would include the text {{{Languages}}}, both on Main Page itself, and on each of its language sub-pages. The template automatically creates links to any language sub-pages that exist, e.g. Main Page/ja<tt>, <tt>Main Page/fr, and ignores non-existant languages.

See Project:Language policy for further details about translating pages.

Supported languages

This shows you the name of each language's sub-page (using Main Page as an example). Other languages may be added easily as necessary. Please use the appropriate prefix, as used on Wikipedia when adding a new language. Please do not add languages for which no pages exist yet, as this will increase the time needed to include the template without adding any benefit (languages are only displayed to the user when the relevant page exists).

The link on the language names goes to the Wikipedia in that language. If no Wikipedia in your language exists, do not add pages in that language to MediaWiki.org! This wiki is not the place for language advocacy - please go through the correct channels, and once your language has a Wikipedia then please return to add content here.

Page Name Language
Main Page English
Main Page/ar Arabic
Main Page/br Breton
Main Page/ca Catalan
Main Page/cs Czech
Main Page/de German
Main Page/el Greek
Main Page/es Spanish
Main Page/fa Persian
Main Page/fi Finnish
Main Page/fr French
Main Page/he Hebrew
Main Page/hu Hungarian
Main Page/id Indonesian
Main Page/it Italian
Main Page/ja Japanese
Main Page/ko Korean
Main Page/mr Marathi
Main Page/nl Nederlands
Main Page/no Norwegian
Main Page/oc Occitan
Main Page/pl Polish
Main Page/pt Portugese
Main Page/ro Romanian
Main Page/ru Russian
Main Page/sq Albanian
Main Page/sr Serbian
Main Page/sv Swedish
Main Page/th Thai
Main Page/vi Vietnamese
Main Page/yue Cantonese
Main Page/zh Chinese
Main Page/zh-hans Chinese (Simplified)
Main Page/zh-hant Chinese (Traditional)

Example

Here is how the language bar looks on the MediaWiki page: Languages

Personal tools
Noteworthy