Help:System message/zh



A system message is a snippet of plain text, wiki text, CSS, or Javascript that can be used to customize the behavior of MediaWiki and its appearance for each language and locale. MediaWiki uses messages for any user-facing part of the interface, allowing for internationalization and localization of the MediaWiki UI, for both core and extensions.

源代码中的信息
All messages used in MediaWiki are defined in a PHP messages file. These files are stored in the languages/message directory of the MediaWiki source code. New messages are added to the English messages file (MessagesEn.php) and the special message documentation file (MessagesQqq.php). From there they are translated into other languages.
 * See also: Localisation

重新定义wiki上的信息
In addition to this, messages can be overridden from their default values by editing them on-wiki. Each message has a wiki page in the MediaWiki namespace with its message key as the name of the page. For example, the "aboutsite" message is stored at MediaWiki:aboutsite. By default this namespace is restricted from editing unless the user has the "editinterface" permission. A list of all message pages can be found on Special:AllMessages. Editing interface messages is typically straightforward, just like editing a normal wiki page, but it is restricted to users with the editinterface permission, which is assigned to sysops by default. The Special:AllMessages table contains two columns: the linked interface name, and the text. The text is horizontally split to show the default text above, and the customized text below. When a custom message does not exist, only the default will be shown. To customize a message, click the upper link in the left column (the name of the message). This link is red if the default text is in use, because the edit page is empty.

The lower links in the left column cells lead to the discussion pages for that message.

Finding messages and documentation
How each message is used by MediaWiki, variables available, parameters used, limitations, et cetera is explained with the [//translatewiki.net/w/i.php?title=Special%3ATranslate&task=reviewall&group=core&language=qqq&limit=5000&tux=0 complete documentation in the qqq pseudo-language] files, as per message documentation guidelines. Some longer explanation pages may exist for some interface messages at the older Category:Interface messages.

In MediaWiki 1.18 and above, you can find a message key by browsing a wiki in the special pseudo-language code qqx, which can be done by appending &uselang=qqx to the URL ([ example]). All the messages will then be replaced by their message keys, so you can identify which message is responsible. In case a message is only visible whilst performing an action &uselang=qqx&debug=1 (example) needs to be appended. Messages that are always in the content language will not be shown using qqx.

参见

 * meta:Help:System message
 * Customization
 * Manual:Configuration settings
 * Manual:Skins
 * Manual:Messages API
 * Localisation
 * FAQ