This page is a translated version of the page Extension:Interwiki and the translation is 100% complete.
Cette extension est fournie avec MediaWiki 1.21 et supérieur. Ainsi vous n'avez pas besoin de la télécharger à nouveau. Néanmoins, vous devez encore suivre les autres instructions fournies.
Manuel des extensions MediaWiki
Interwiki
État de la version : stable
Implémentation Page spéciale
Description Ajoute une page spéciale pour afficher et manipuler la table interwiki
Auteur(s) Stephanie Amanda Stevens, SPQRobin
Dernière version 3.2 (2019-07-15)
MediaWiki 1.36+
Modifie la base
de données
Non
Licence Licence publique générale GNU v2.0 ou supérieur
Téléchargement
Exemple Voir Extension:Interwiki/Sites using this extension
  • $wgInterwikiViewOnly
  • InterwikiCentralDB
interwiki
Téléchargements trimestriels 121 (Ranked 60th)
Utilisé par les wikis publics 4,929 (Ranked 181st)
Traduire l’extension Interwiki sur translatewiki.net si elle y est disponible
Problèmes Tâches ouvertes · Signaler un bogue

L'extension Interwiki ajoute la page Special:Interwiki à MediaWiki , pour voir et modifier la table interwiki , et tracer toutes les actions faites par elle.

Elle utilise la variable $wgInterwikiCache . Les modifications faites avec elle sur la table interwikis peuvent impacter le comportement à la fois des transclusions et des liens interwikis .

La liste de Special:Interwiki est identique à l'API api.php?action=query&meta =siteinfo&siprop=interwikimap, hormis le champs iw_api qui n'est pas disponible.

Installation

  • Téléchargez et placez le(s) fichier(s) dans un répertoire appelé Interwiki dans votre dossier extensions/.
    Les développeurs et les contributeurs au code doivent à la place installer l'extension à partir de Git en utilisant:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Interwiki
  • Ajoutez le code suivant à la fin de votre fichier LocalSettings.php  :
    wfLoadExtension( 'Interwiki' );
    // Pour donner aux ''sysops'' la permission d'éditer les données interwiki
    $wgGroupPermissions['sysop']['interwiki'] = true;
    
    // Pour créer un nouveau groupe d'utilisateurs pouvant éditer les données interwiki
    // (les ''bureaucrats'') peuvent ajouter des utilisateurs à ce groupe
    # $wgGroupPermissions['developer']['interwiki'] = true; // supprimer l'indicateur de commentaire # si nécessaire
    
  •   Fait – Accédez à Special:Version sur votre wiki pour vérifier que l'extension a bien été installée.
  • La configuration de base de Mediawiki n'accorde de permission à aucun groupe d'utilisateurs. Aussi, vous devrez ajouter par vous-même la configuration sinon personne ne pourra éditer d'intewikis.
  • Pour activer la transclusion depuis d'autres sites, vous devrez activer $wgEnableScaryTranscluding .
  • Pour désactiver l'ajout de préfixes via l'interface Special:Interwiki, mettre $wgInterwikiViewOnly à true.
Cette entrée d'extension dans la liste des pages spéciales n'est pas le nom de l'extension. Cette entrée dans la liste est définie par l'élément de message interwiki défini par la locale dans SpecialInterwiki.i18n.php. Sa valeur est Voir et modifier les données interwiki.

Réglages des liens interlangues

To set up interlanguage links using this extension, make sure that $wgInterwikiMagic is set to true and $wgHideInterlanguageLinks is set to false (they are like this by default, you don't need to change them usually). The $wgInterwikiViewOnly also needs to be set to false (which it is by default). Then go to Special:Interwiki as a user with the ability to edit interwikis. That is controlled by the interwiki permission, and by default, no user group has this permission, so it needs to be added to a user group with, e.g.

$wgGroupPermissions['sysop']['interwiki'] = true;

Once on Special:Interwiki, you can either click the "Add an interwiki or language prefix" link at the top of the table, or click the "Edit" or "Delete" links in the table row of an existing interwiki prefix.

Choosing to add or edit an interwiki prefix will take you to a separate page with a form with various fields to be filled. The main fields are "name", which is the prefix that would be used for the links, and "URL", where you put the full URL pattern. For example, setting name=foowiki and URL=http://fr.foowiki.tld/wiki/$1 would make [[foowiki:Blah]] point to http://fr.foowiki.tld/wiki/Blah.

There are also two checkboxes labeled "Forward" and "Transclude". See Manual:Interwiki table for a full explanation of the forward (iw_local) and transclude (iw_trans) bits.

In brief:

  • Enabling forwarding ('local' true) is normally done between all languages and projects in the same group, as it allows a link to any one of the languages to be used as a gateway to the others. The English-language Wikipedia, for instance, sets the 'local' bit true for all of the other-language Wikipedias and for projects like commons:, wikinews: or wikivoyage:. A user on a wiki outside Wikipedia where the wikipedia: interwiki prefix points to en.wikipedia.org could create a link like wikipedia:fr:Encyclopédie. That link goes initially to "fr:Encyclopédie" on the English-language Wikipedia. The en.wikipedia server immediately recognises fr: as a 'local' interwiki link, so replies with a redirect to la Wikipédia where fr.wikipedia.org/wiki/Encyclopédie displays the requested French-language Wikipédia page [[Encyclopédie]] et voilà.
  • Enabling transclusion is rarely done, as it allows an article on one wiki to use templates from some other wiki. This is referred to as 'scary transclusion' as it will cause problems if the other wiki changes the template unexpectedly. A few wiki farms use this to create one 'central wiki' with various templates which are made available to other wikis in the same farm. If you don't need this, don't enable it.

Interwikis globaux

Since version 3, Interwiki supports defining a global/central database and pulling defined interwikis from there as well as from the local table. This functions essentially as a table merge, with local interwiki definitions overriding central. Language links are not pulled from the central table; these are set up as local-only due to a central table likely serving more than one project (with each having its own languages).

The central table is the interwiki table of the central wiki. This means that as far as the central wiki is concerned, it is basically just a normal non-global setup. There are therefore no special rights associated with the central (global) table, though it is likely you may want to be more picky about how you assign the 'interwiki' edit right on this wiki.

  • This was decided by looking at current possible use cases (ShoutWiki's hub, Uncyclomedia's central wiki, and Meta-Wiki) where the central wiki isn't going to have anything extra anyway.
  • This might change in the future, but anything more intelligent will require schema updates.
  • This probably doesn't work with table prefixes because of how the table is accessed.

To set up a central interwiki table, simply provide the name of the database of the wiki you want to use:

// To enable pulling global interwikis from a central database
$wgInterwikiCentralDB = 'mw_central';

Replace 'mw_central' with the name of the database.

For those using table prefixes here is an alternative solution for "pool_example_wiki" tables.

$wgSharedDB = 'example_wiki'; # The $wgDBname for the wiki database holding the main interwiki table
$wgSharedPrefix = 'pool_'; # The $wgDBprefix for the database. Defaults to the prefix of the current wiki if not specified
$wgSharedTables = ['interwiki'];

URLs dépendant du protocole

You can use protocol-relative URLs (PRURLs), so that users accessing your wiki over either HTTP or HTTPS can uses that same protocol to access interwiki links. To use a PRURL, first ensure the destination server supports HTTPS; if it does, then simply remove the https: portion of the URL in the link table. For example, change

https://en.wikipedia.org/wiki/$1

to:

//en.wikipedia.org/wiki/$1