User:E.Z.O./babel-ja

From MediaWiki.org
Jump to navigation Jump to search
MediaWiki 拡張機能マニュアル
OOjs UI icon advanced.svg
Babel
リリースの状態: 安定
実装 パーサー拡張機能
説明 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 以降
ダウンロード
CHANGELOG
Translatewiki.net
$wgBabelLanguageCodesCdb
$wgBabelLanguageNamesCdb
$wgBabelCategoryNames
$wgBabelMainCategory
$wgBabelDefaultLevel
$wgBabelUseUserLanguage
translatewiki.net で翻訳を利用できる場合は、E.Z.O. 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

babel拡張機能は、完全にテンプレートに依存していたバベルのシステムを置き換えるためのパーサの機能が追加されます。これには、下位互換性があり、そして既存のテンプレートをサポートしています(それらは単純に拡張機能を無効にします)。

ウィキペディアでは、バベル(名前はバベルの塔が元)は利用者ページ上で簡単に特定の言語を話せる人に連絡することにより、多言語コミュニケーションを助けるテキストを指します。アイデアはウィキメディア・コモンズに由来し、また他の多くのウィキに実装されています。

インストール[edit]

  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.

Usage[edit]

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-0
その言語を全くを理解していない場合。
xx-1
基本的な理解 - 書き込む材料またはこの言語で簡単な質問を理解するのに十分な場合。
xx-2
中級の理解 - 十分な編集や議論ができる場合。
xx-3
高度なレベル - 何の問題もなくこの言語で記述できるが、いくつかの小さな問題等が生じる可能性がある場合。
xx-4
"ネイティブに近い"レベル - 最初から使用している、母語ではありませんが、あなたの能力は、母語話者のようなものです。
xx-5
その言語のプロフェッショナル。
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.

Configuration[edit]

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

$wgBabelLanguageCodesCdb 
(string) the path of the language code database file, the default should suffice.
$wgBabelLanguageNamesCdb 
(string) the path of the language name database file, the default should suffice.
$wgBabelCategoryNames 
(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.
$wgBabelMainCategory 
(string) Name of the main (non-level) category for each language, set to false to disable. Uses same variables as $wgBabelCategoryNames.
$wgBabelDefaultLevel 
(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.

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

Releases[edit]

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]