Help:Extension:Translate/Group configuration/ja

メッセージ群を翻訳拡張機能に追加する方法はいくつかあります. ここではメッセージの集合をメッセージ群と呼びます. 通常はソフトウェアのモジュールとファイルに1対1で対応します (また対応は翻訳目的語ごとに1件. ) メッセージ群に他のメッセージ群を含ませることも可能です. 例えば特定のソフトウェア内のメッセージをすべてまとめたメッセージ群が作れます. あるいはまたMediaWiki の最重要なメッセージで必ず最初に翻訳するべきものなど、メッセージのサブセット限定でまとめる方法もあります. そのような高いレベルのメッセージ群はファイルとのマッピングに固有の形式がないものの、他のメッセージ群同様に他の翻訳ツールへの書き出しを Gettext 形式で実行できます.

翻訳者にとってメッセージ群は高いレベルの作業対象です. どの単一のメッセージを翻訳するか選ぶには、先にメッセージ群を決めるのが手順で、翻訳検索をした場合とは異なります. メッセージ群単位で固有の識別子が付き、統計の対象にできます. 当然ながらメッセージ群は翻訳者が一度に取り掛かる最小の文の集合です. メッセージ単位で識別子を与えてあり、これを通常はkey (キー) と呼びます. キーは複数のメッセージ群で共有しても問題ありません.

標準のメッセージ群の設定形式
YAML 形式を使ったメッセージ群の追加が簡単です. に追加する設定ファイルに名前空間を定義すればよいのです. 詳細は設定ページをご参照ください. サンプルを示します.

The file itself uses the YAML syntax. The syntax itself is not described here, but it is easy to learn, and all the premade groups can be used as examples. Remember to use spaces instead of tabs for indentation. Each file can define multiple message groups. Each group definition is separated by a line with three dashes, which is the standard document separator in YAML.

Definitions are broken into few top-level items: BASIC, FILES, MANGLER, CHECKER, INSERTABLES, TAGS, AUTOLOAD, LANGUAGES and special TEMPLATE. Some custom groups may add more top-level items. Not all groups need to define all of them.

BASIC
This section contains basic information about the group, like unique id and name. List of possible keys (mandatory keys are marked with *): Example:

FILES
This section describes the filesystem layout and format of message files for groups of type FileBasedMessageGroup. List of possible keys (mandatory keys are marked with *):

The path variables are: Example:

MANGLER
Mangler is a way to mungle message keys to avoid conflicting message keys in multiple groups: Example:

CHECKER
Checkers run checks on the translated messages. If they find problems, those translations are highlighted for translators. Example:

INSERTABLES
This section allows to define a class which suggests insertables. The classes can be autoloaded as described in the AUTOLOAD section.

TAGS
It is possible to assign tags to messages. Each tag takes list of message keys (after mangling). "*" can be used as wildcard. The following tags are supported: Example:

AUTOLOAD
This item takes list of class names with filenames as values. This way custom classes can be bundled easily with your custom message groups. The path should be relative to the location of the group configuration file itself.

Example:

TEMPLATE
There is a handy shortcut if you are defining multiple similar message groups. To avoid repetition, have the first definition start with this key. You can use any other top-level keys as subkeys for this item. All other groups will use these definitions as default values. Each group can of course override the default value from the template.

Example:

GROUPS (for AggregateMessageGroup class)
This key only takes list of group ids this message group consists of.

Example: Wildcards are supported. In this case the aggregate group will not recursively include itself even if it matches a pattern. Example: Wildcards can be problematic if you have nested aggregate groups, because some groups can be included multiple times: both directly and via the included aggregate groups.

LANGUAGES
This key allows white listing and black listing of languages for the group. Blacklisted languages will not be allowed for translation. Whitelist overrides any values in the blacklist. If whitelist value is  that means all languages are allowed. Whitelist is also optional.

Message groups for interface messages specific to your wiki
Example of message group for custom user interface of the wiki, for example for localized sidebar. Add the following code into your  and replace wikiname with something meaningful.

MediaWiki 拡張機能のショートカット
MediaWikiの単位のグループunits group for MediaWikiをご参照ください.