Extension:Interwiki/ru
![]() Статус релиза: стабильноCategory:Stable extensions/ru |
|
---|---|
![]() |
|
Реализация | Служебная страницаCategory:Special page extensions/ru |
Описание | Добавляет служебную страницу для просмотра и управления таблицей интервики |
Автор(ы) | Stephanie Amanda Stevens, SPQRobin |
Последняя версия | 4.0 |
MediaWiki | 1.36—1.43Category:Extensions with manual MediaWiki version/ru |
Изменения в БД | Нет |
Лицензия | GNU General Public License 2.0 или позднее |
Скачать | Category:Extensions in Wikimedia version control/ru |
Пример | Special:Interwiki |
|
|
interwiki
Category:Extensions which add rights/ru |
|
Переведите расширение Interwiki, если оно доступно на translatewiki.net | |
Проблемы | Открытые задачи · Сообщить об ошибке |
Расширение Interwiki добавляет в MediaWiki страницу "Special:Interwiki
", позволяющей просмотреть и редактировать таблицу interwiki
, а также журнал всех действий, выполненных с ней.
Это расширение работает с переменной $wgInterwikiCache
.
Изменения, внесенные с помощью расширения в таблицу interwiki
, могут повлиять на поведение как трансклюзии , так и ссылок interwiki
Список "Interwiki" идентичен API api.php?action=query&meta =siteinfo&siprop=interwikimap
, за исключением того, что поле iw_api
не доступно.
Установка
- Скачайте и распакуйте файл(ы) в папку с названием
Interwiki
в вашей папкеextensions/
.
Вместо этого разработчикам и соавторам кода следует установить расширение из Git, используя:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Interwiki
- Добавьте следующий код в конце вашего файла LocalSettings.php :
wfLoadExtension( 'Interwiki' ); // To grant a group (e.g., the "sysop" group) permission to edit interwiki data $wgGroupPermissions['sysop']['interwiki'] = true;
Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.
- 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 Просмотр и изменение настроек интервики.Configuration
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 Добавить языковой или интервики-префикс
link at the top of the table, or click the Править
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 Пересылка
and Включение
.
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 thelocal
bittrue
for all of the other-language Wikipedias and for projects likecommons:
,wikinews:
orwikivoyage:
. A user on a wiki outside Wikipedia where thewikipedia:
interwiki prefix points toen.wikipedia.org
could create a link like wikipedia:fr:Encyclopédie. That link goes initially tofr:Encyclopédie
on the English-language Wikipedia. Theen.wikipedia
server immediately recognisesfr:
as alocal
interwiki link, so replies with a redirect to la Wikipédia wherefr.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.
Глобальные интервики
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:
// 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 use 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
![]() | Это расширение используется в одном или нескольких проектах Викимедиа. Вероятно, это означает, что расширение стабильно и работает достаточно хорошо, чтобы использоваться такими сайтами с высоким трафиком. Найдите название этого расширения в файлах конфигурации Викимедиа CommonSettings.php и InitialiseSettings.php, чтобы узнать, где оно установлено. Полный список расширений, установленных на конкретной вики, можно увидеть на странице Special:Version wiki. |
![]() | Это расширение включено в следующие вики-фермы/хостинги и/или пакеты:
|