Open main menu

lensowiki β

Changes

Help:MediaWiki namespace

5,853 bytes added, 10:33, 13 June 2006
most stuff is in Messages.php, no idea where the old example now is
{{h:h|moderator toc}}

The '''MediaWiki namespace''' is one of the 16 standard [[Help:namespace|namespaces]] in the database structure of the MediaWiki software.

== Overview ==

The '''MediaWiki namespace''' is a mechanism allowing [[Help:Administration|administrator]]s to [[MediaWiki localization|customise or translate the MediaWiki web interface]]. It is enabled by default in recent mediawiki versions, {{h:mwg|UseDatabaseMessages}} = true enables them.

All messages defined can be viewed at [[Special:Allmessages]] with some nice features. Because this displays '''all''' system messages (over 1 MB) some users might prefer to view these messages alphabetically:
[{{fullurl:Special:Allpages|from=MediaWiki:%21}} @] [[Special:Prefixindex/MediaWiki:A|A]] [[Special:Prefixindex/MediaWiki:B|B]] [[Special:Prefixindex/MediaWiki:C|C]] [[Special:Prefixindex/MediaWiki:D|D]] [[Special:Prefixindex/MediaWiki:E|E]] [[Special:Prefixindex/MediaWiki:F|F]] [[Special:Prefixindex/MediaWiki:G|G]] [[Special:Prefixindex/MediaWiki:H|H]] [[Special:Prefixindex/MediaWiki:I|<small>&#160;</small>I<small>&#160;</small>]] [[Special:Prefixindex/MediaWiki:J|J]] [[Special:Prefixindex/MediaWiki:K|K]] [[Special:Prefixindex/MediaWiki:L|L]] [[Special:Prefixindex/MediaWiki:M|M]] [[Special:Prefixindex/MediaWiki:N|N]] [[Special:Prefixindex/MediaWiki:O|O]] [[Special:Prefixindex/MediaWiki:P|P]] [[Special:Prefixindex/MediaWiki:Q|Q]] [[Special:Prefixindex/MediaWiki:R|R]] [[Special:Prefixindex/MediaWiki:S|S]] [[Special:Prefixindex/MediaWiki:T|T]] [[Special:Prefixindex/MediaWiki:U|U]] [[Special:Prefixindex/MediaWiki:V|V]] [[Special:Prefixindex/MediaWiki:W|W]] [[Special:Prefixindex/MediaWiki:X|X]] [[Special:Prefixindex/MediaWiki:Y|Y]] [[Special:Prefixindex/MediaWiki:Z|Z]]

The contents of the MediaWiki namespace pages override any corresponding settings in the language files, i.e., the static version of messages. Using the MediaWiki namespace is a bit slower.

==Protection==

By default, all messages are protected. This is necessary for a number of reasons:

* Many messages are in plain HTML, hence users could insert malicious scripts
* Vandalism of some messages would be extremely disruptive, for example changes to the text of the links in the sidebar would immediately be visible to all users
* A few messages can in theory cause the software to stop working if they are changed, for example [[MediaWiki:Linktrail]]. In practice the software ignores the database contents for [[MediaWiki:Linktrail]], taking the regular expression straight out of the message files, for performance and stability reasons.

If an administrator wishes to allow general editing of a MediaWiki page, a method is to place the message on a template, and then transclude the template back onto the MediaWiki page.

==Technical details==

The namespace number of {{ns:8}} messages is '''8''', with a corresponding {{ns:9}} namespace '''9''' to discuss individual messages.
Some projects offer templates like {{tiw|en|editprotected}} to propose modifications, others have a page like
[[m:Meta:Requests for help from a sysop or bureaucrat|Meta:Requests for help from a sysop or bureaucrat]] for this purpose.

;Links to MediaWiki messages work like links to ordinary pages, examples&#58;
:<tt><nowiki>[[MediaWiki:Edit]]</nowiki></tt> [[MediaWiki:Edit]],
:<tt><nowiki>[[w:de:MediaWiki:Edit]]</nowiki></tt> [[w:de:MediaWiki:Edit]],
:<tt><nowiki>[{{fullurl:m:MediaWiki:Edit|action=render}} demo]</nowiki></tt> [{{fullurl:m:MediaWiki:Edit|action=render}} demo].

Each message in the <code>$wgAllMessagesEn</code> array in [http://svn.wikimedia.org/svnroot/mediawiki/trunk/phase3/languages/Messages.php Messages.php] corresponds to a page in the MediaWiki namespace. For example, there is a line in the php file:

'confirmprotect' =&gt; 'Confirm protection',

To this corresponds the page [[MediaWiki:Confirmprotect]], and {{evaldemo|int:Confirmprotect}}. When this page is edited the new message is automatically used for say {{fullurl:m:Main page|action=protect}}. Similarly [[w:fr:MediaWiki:Confirmprotect]] has the content <em>Confirmer la protection</em>, note that the page name itself is not translated.

===Inclusion===
;Inclusion of MediaWiki messages can make sense, as noted below historically these messages also covered the function of templates.
:{{evaldemo|MediaWiki:Edit|&#61;}}, see {{tim|Ed}}.
:{{evaldemo|int:Edit|&#61;}}, [[Help:colon function|colon function]] '''int:''' is a shorthand for '''MediaWiki:'''.
:{{evaldemo|int:Erehwon|&#61;}}, but only as far as the message exists.
:{{evaldemo|MediaWiki:Erehwon|&#61;}} doesn't exist.

However many messages are not suited for inclusion, because they contain '''$1''' and similar parameters not evaluated by the
template parser, or raw [[w:Cascading Style Sheets|CSS]] and [[w:en:XHTML|XHTML]] markup not permitted on normal pages.

===Interlanguage links===
[[Help:Interwiki linking|Interlanguage link]]s in MediaWiki messages typically won't work as expected. Adding <tt>&lt;noinclude&gt;</tt> isn't good enough, because something has to evaluate it, as it's the case for messages [[#Inclusion|included]] like ordinary templates, but not {{unclear}} for messages used internally as system messages.

Instead, one can use in-page interlanguage links on the talk pages, {{tim|ilm}} does this for some major projects.

===Strings exclusive to language file===
Some text strings cannot be customised using this feature, and so can only be changed by editing the language file. These include:

* The namespace titles "User", "Wikipedia", "Image", etc.
* The names of the special pages
* Month and days-of-the-week names
* A number of items in [[Special:Preferences]]

==See also==

*[[m:Help:MediaWiki namespace/old|MediaWiki namespace in version 1.26]]
*[[w:Wikipedia:MediaWiki namespace]]

{{h:f|enname=MediaWiki namespace}}
Anonymous user