Extension:Interwiki/pt
Interwiki Estado de lançamento: estável |
|
---|---|
File:MediaWiki extension Interwiki.png | |
Implementação | Página espacial |
Descrição | Adiciona uma página especial para visualizar e manipular a tabela de interwiki |
Autor(es) | Stephanie Amanda Stevens, SPQRobin |
Última versão | 3.2 (2019-07-15) |
MediaWiki | 1.36+ |
Alterações à base de dados | Não |
Licença | GNU - Licença Pública Geral 2.0 ou superior |
Transferência | |
Exemplo | See Extension:Interwiki/Sites using this extension |
|
|
interwiki |
|
Quarterly downloads | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Public wikis using | Lua error in Module:Extension at line 172: bad argument #1 to 'inNamespace' (unrecognized namespace name 'skin'). |
Traduza a extensão Interwiki se ela estiver disponível em translatewiki.net | |
Problemas | Tarefas em aberto · Reportar um erro |
The Interwiki extension adds the "Special:Interwiki" page to MediaWiki , to view and edit the interwiki table, and a log of any actions made with it.
This extension works with the $wgInterwikiCache variable. Changes made with it to the interwiki table can affect the behavior of both transclusion and interwiki links .
The list of "Special:Interwiki" is identical to the API api.php?action=query&meta =siteinfo&siprop=interwikimap
, except the iw_api
field is not available.
Instalação
- <translate> [[<tvar name=2>Special:ExtensionDistributor/Interwiki/pt</tvar>|Download]] and move the extracted <tvar name=name>
Interwiki/pt
</tvar> folder to your <tvar name=ext>extensions/
</tvar> directory.</translate>
<translate> Developers and code contributors should install the extension [[<tvar name=git>Special:MyLanguage/Download from Git</tvar>|from Git]] instead, using:</translate>cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Interwiki%2Fpt - <translate> Add the following code at the bottom of your <tvar name=1>LocalSettings.php </tvar> file:</translate>
wfLoadExtension( 'Interwiki/pt' ); // To grant sysops permissions to edit interwiki data $wgGroupPermissions['sysop']['interwiki'] = true; // To create a new user group that may edit interwiki data // (bureaucrats can add users to this group) # $wgGroupPermissions['developer']['interwiki'] = true; // delete the comment indicator # as appropriate
- File:OOjs UI icon check-constructive.svg <translate> Done</translate> – <translate> Navigate to <tvar name=special>Special:Version</tvar> on your wiki to verify that the extension is successfully installed.</translate>
- The configuration that comes with MediaWiki will not grant permission to any user group.
- To enable transclusion from other sites, you'll need to enable
$wgEnableScaryTranscluding
.
- To disable adding prefixes through the Special:Interwiki interface, set
$wgInterwikiViewOnly
totrue
.
interwiki
message item defined per locale in SpecialInterwiki.i18n.php
. Its value is ⧼interwiki⧽.Setting up interlanguage links
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.
Global interwikis
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'];
Protocol-relative URLs
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
File:Wikimedia-logo black.svg | <translate> This {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is being used on one or more [[<tvar name=2>m:Special:MyLanguage/Wikimedia projects</tvar>|Wikimedia projects]].</translate> <translate> This probably means that the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension|skin}} is stable and works well enough to be used by such high-traffic websites.</translate> <translate> Look for this {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extension's|skin's}} name in Wikimedia's <tvar name=2>CommonSettings.php</tvar> and <tvar name=3>InitialiseSettings.php</tvar> configuration files to see where it's installed.</translate> <translate> A full list of the {{<tvar name=1>#ifeq:Extension|Extension</tvar>|extensions|skins}} installed on a particular wiki can be seen on the wiki's <tvar name=ver>Special:Version</tvar> page.</translate> |
MediaWiki extension Interwiki.png |
- Pages with script errors
- Extensions bundled with MediaWiki 1.21/pt
- Pages with broken file links
- Stable extensions/pt
- Special page extensions/pt
- Extensions with manual MediaWiki version
- GPL licensed extensions/pt
- Extensions in Wikimedia version control/pt
- Extensions which add rights/pt
- All extensions/pt
- Extensions not in ExtensionJson
- Extensions used on Wikimedia/pt
- Interwiki extensions/pt