Extension:Interwiki
![]() リリースの状態: 安定 |
|
---|---|
![]() |
|
実装 | 特別ページ |
説明 | interwikiテーブルの参照や操作を行う特別ページを追加する |
作者 | Stephanie Amanda Stevens, SPQRobin |
最新バージョン | 3.2 (2019-07-15) |
MediaWiki | 1.36+ |
データベースの変更 | いいえ |
ライセンス | GNU 一般公衆利用許諾書 2.0 以降 |
ダウンロード | |
例 | Extension:Interwiki/Sites using this extension を参照してください |
|
|
interwiki |
|
Quarterly downloads | 131 (Ranked 72nd) |
Public wikis using | 202 (Ranked 409th) |
translatewiki.net で翻訳を利用できる場合は、Interwiki 拡張機能の翻訳にご協力ください | |
問題点 | 未解決のタスク · バグを報告 |
Interwiki 拡張機能は MediaWiki に「Special:Interwiki」ページを追加します。ここでは、interwiki テーブルおよびそれを使って行われた操作記録の閲覧や編集ができます。
$wgInterwikiCache 変数と一緒に動作します。 Changes made with it to the interwiki table can affect the behavior of both transclusion and interwiki links .
「特別:インターウィキ」は iw_api
フィールドが使えないことを除き api.php?action=query&meta =siteinfo&siprop=interwikimap
のAPIと同じです。
ダウンロード
拡張機能は、Git から直接取得できる場合があります [?]:
- コードを参照
- 一部の拡張機能には安定版リリースのタグがあります。
- タグを参照
- タグを選択します
- 「スナップショット」をクリックします
- 各ブランチは過去の MediaWiki リリースと関連付けられています。 最新のアルファ バージョンを含む「master」ブランチもあります (MediaWiki のアルファ バージョンが必要な場合用)。
- ブランチを参照
- ブランチ名を選択します
- 「選択」をクリックします
スナップショットを展開して、MediaWiki インストレーション内の extensions/Interwiki/ ディレクトリに配置します。
git に馴染みがあり、かつサーバーにシェルでアクセスできる場合は、拡張機能を以下のようにして取得することもできます:
cd extensions/
git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/Interwiki.git
インストール
- ダウンロードして、ファイルを
extensions/
フォルダー内のInterwiki
という名前のディレクトリ内に配置します。 - 以下のコードを
LocalSettings.php
の末尾に追加します:wfLoadExtension( 'Interwiki' ); // システム管理者の interwiki データ編集を認める $wgGroupPermissions['sysop']['interwiki'] = true; // interwiki データの編集を担当する利用者グループを新設する // (ビューロクラットはこのグループに利用者を追加できます) # $wgGroupPermissions['developer']['interwiki'] = true; // 適切としてコメント指示子 # を除去
- 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。
- MediaWiki に付属する設定が許可を与える特定の利用者グループはありません。 そのため、利用者が自分で設定を追加しない限り、誰も interwiki の編集はできません。
- 他のサイトから参照読み込みができるようにするには、
$wgEnableScaryTranscluding
を可能に設定してください。 - Special:Interwiki インターフェースを使った接頭辞の付与を無効にするには、
$wgInterwikiViewOnly
をtrue
に設定。
SpecialInterwiki.i18n.php
に定義されるメッセージ項目 interwiki
に依拠します。 値は インターウィキデータの閲覧と編集 です。
言語間リンクを設定
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).
Then go to Special:Interwiki as a user with the appropriate permissions.
For example, if the French version of your wiki was located at http://fr.foowiki.tld/wiki/
, you could add http://fr.foowiki.tld/wiki/$1
to the interwiki table with values trans 0 and local 0.
Then the interlanguage link to the French version would work, but a #REDIRECT to a French-language page from a page in some other language would be refused.
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.
グローバル ウィキ間ウィキ
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'];
相対プロトコルURL
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
この拡張機能は 1 つ以上のウィキメディアのプロジェクトで使用されています。 これはおそらく、この拡張機能が安定していて高いトラフィックのウェブサイトでも十分に動作することを意味します。 この拡張機能がインストールされている場所を確認するには、ウィキメディアの設定ファイル CommonSettings.php および InitialiseSettings.php 内で、この拡張機能の名前を探してください。 特定のウィキにインストールされている拡張機能の完全な一覧は、そのウィキの Special:Version ページにあります。 |
この拡張機能は以下のパッケージ/ウィキファームに含まれています: This is not an authoritative list. Some wiki farms/hosts may contain this extension even if they are not listed here. Always check with your wiki farms/hosts or bundle to confirm. |