Jump to navigation Jump to search
MediaWiki 拡張機能マニュアル
OOjs UI icon advanced.svg
リリースの状態: 安定
実装 パーサー拡張機能
説明 Adds a parser function to inform other users about language proficiency and categorise users of the same levels and languages.
作者 Robert Leverington (RobertLtalk)
最新バージョン 1.7.4 (2011-12-18)
MediaWiki 1.16.0 or higher (r52203)
ライセンス GNU 一般公衆利用許諾書 2.0 以降
$wgBabelUseUserLanguage で翻訳を利用できる場合は、E.Z.O. 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告




  1. Download the files from SVN or download a snapshot. Choose the version that matches your version of MediaWiki.
  2. Create a directory Babel in your $IP/extensions directory.
  3. Extract the files to this $IP/extensions/Babel directory.
  4. Add
    require_once( "$IP/extensions/Babel/Babel.php" );
    to the bottom of LocalSettings.php.
  5. Copy the code from Babel.css file into your MediaWiki:Common.css — you can change it as desired. This is not needed from version 1.19 forward.
  6. Installation can now be verified through Special:Version of your wiki.

If the CLDR extension is found language names are taken from that (where translations are unavailable), otherwise built in MediaWiki language names and English defaults are used.


Syntax for the #babel parser function is as follows:

{{#babel: babelcode1 | babelcode2 | ... }}

Add one of the following codes for each language you speak or understand, separated by |, where xx is the MediaWiki language code, ISO 639-1 code, or ISO 639-3 code for the language. The general usage of each code level is as follows:

基本的な理解 - 書き込む材料またはこの言語で簡単な質問を理解するのに十分な場合。
中級の理解 - 十分な編集や議論ができる場合。
高度なレベル - 何の問題もなくこの言語で記述できるが、いくつかの小さな問題等が生じる可能性がある場合。
"ネイティブに近い"レベル - 最初から使用している、母語ではありませんが、あなたの能力は、母語話者のようなものです。
xx or xx-N

To include any other template, simply add the name of the template, e.g. add User from London if you want to include Template:User from London. A prefix or suffix may be added to template names (e.g. User at the beginning) depending on the local configuration, this can be used to restrict the selection and reduce the length of parameters; for example from London could include Template:User from London if configured in such a way.


Babel has five configuration variables which can be modified in LocalSettings.php.

(string) the path of the language code database file, the default should suffice.
(string) the path of the language name database file, the default should suffice.
(array of string or boolean, indexed by the strings '1, '2', … '5', 'N') where each entry is the name of a category for the skill level indicated by its index, possible variable elements are: %code% (language code), %wikiname% (the name of the language in the wiki's content language), and %nativename% (the name of the language in its language). To disable adding a category for a particular level, set the corresponding value to false.
(string) Name of the main (non-level) category for each language, set to false to disable. Uses same variables as $wgBabelCategoryNames.
(string) Default ability level to use when none is specified, should be an index from $wgBabelCategoryNames, that is one of the strings '1, '2', … '5', 'N'

Several customizations can also be made using MediaWiki namespace messages.

The format of template names when one is being included.
The format of the target of the link from the language code.
Username to be used for autocreation of Babel related categories
Text to insert into auto-created categories for different language levels.
Text to insert into auto-created categories for non-level categories.
The header of the babel box
The pagename where information on the babel extension can be found
The footer of the babel box
The page to link to in the footer of the babel box


Version Release date Comments
0.1 2008-04-19 Initial version.
0.7 2008-04-26 First beta.
0.9 2008-05 Second beta - still some known issues.
1.0 2008-07-02 Now stable.
1.1.0 2009-02-22 Rewrite language logic.
1.2.0 2009-02-22 Rewrite parameter parser (all MediaWiki supported languages now work), remove options parser (gender moved to core).
1.2.1 2009-02-22 Gender support for 'babel' message.
1.2.2 2009-02-22 Change parser hook callback to be PHP 5.2.0 and lower compatible.
1.2.3 2009-02-26 Comment and whitespace alteration, fix possible exception by always returning null on an invalid language.
1.3.0 2009-07-23 Replace language code handling with CDB.
1.4.0 2009-08-14 New style magic words.
1.4.1 2009-08-15 Do not handle empty values.
1.5.0 2011-01-20 Updated language codes and names database, improve general code quality.
1.6.0 2011-01-21 Category name configuration moved from MediaWiki namespace messages to $wgBabelCategoryNames configuration variable.
1.7.0 2011-01-24 Flexibility and code quality improvements. Replaced $wgBabelUseLevelZeroCategory, $wgBabelUseSimpleCategories, and $wgBabelUseMainCategories with $wgBabelCategoryNames, $wgBabelMainCategory, and $wgBabelDefaultLevel.
1.7.1 2011-07-14 (bug 29663) Do nothing if the username of "babel-autocreate-user" is invalid. Do not create categories if the user is blocked.
1.7.2 2011-08-09 Use ResourceLoader for adding CSS.

See also[edit]