m get rid of bogus fr: interlanguage link |
m TRANSWIKI from Meta |
||
Line 1: | Line 1: | ||
{{h:h|moderator toc}} |
{{h:h|moderator toc}} |
||
The '''MediaWiki namespace''' is one of the 16 standard namespaces in the database structure of the MediaWiki software |
The '''MediaWiki namespace''' is one of the 16 standard [[Help:namespace|namespaces]] in the database structure of the MediaWiki software. |
||
== Overview == |
== Overview == |
||
⚫ | The '''MediaWiki namespace''' is a mechanism allowing |
||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
[{{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> </small>I<small> </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]] |
|||
⚫ | |||
"fromwikipedia" => "From $wgSitename, the free encyclopedia." |
|||
To this corresponds the page [[w:MediaWiki:Fromwikipedia]] whose whole content is "From Wikipedia, the free encyclopedia.". It is the message which is displayed at the top of each page of the English Wikipedia. When this page w:en:MediaWiki:Fromwikipedia is edited the new message appears automatically at the top of every page of the English Wikipedia. Similarly [[w:fr:MediaWiki:Fromwikipedia]] has the content "Un article de Wikipédia, l'encyclopédie libre." (note that the page name itself is not translated). |
|||
⚫ | |||
==Protection== |
==Protection== |
||
Line 22: | Line 19: | ||
* 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 |
* 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. |
* 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. |
||
However, some messages do not suffer from any of these disadvantages, and it is expected that these messages will be identified and unprotected at some stage. |
|||
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. |
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. |
||
Line 37: | Line 32: | ||
:<tt><nowiki>[[w:de:MediaWiki:Edit]]</nowiki></tt> [[w:de: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]. |
:<tt><nowiki>[{{fullurl:m:MediaWiki:Edit|action=render}} demo]</nowiki></tt> [{{fullurl:m:MediaWiki:Edit|action=render}} demo]. |
||
⚫ | |||
'confirmprotect' => '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=== |
||
Line 60: | Line 61: | ||
* Month and days-of-the-week names |
* Month and days-of-the-week names |
||
* A number of items in [[Special:Preferences]] |
* A number of items in [[Special:Preferences]] |
||
'''''For MediaWiki version 1.3 and later, see further [[Help:Template]]. What follows below is for earlier versions.''''' |
|||
==MediaWiki version 1.2.6== |
|||
For versions before 1.3, another important function of the MediaWiki namespace is to provide customised, often used messages to use in articles (see [[MediaWiki namespace#Access|Access]] section below and the use of ''MSG'' and ''SUBST''). |
|||
===Access=== |
|||
Besides use by the PHP script, messages can be accessed from inside articles. There are three special tags for this purpose, listed below. This makes it possible to create messages for boilerplate text, such as [[en:Wikipedia:Articles for deletion|AFD]] notices and [[w:Wikipedia:stub|stub]] warnings. Instead of pasting in the stub warning from [[en:Wikipedia:Boilerplate text]], you could just type <nowiki>{{SUBST:stub}}</nowiki>. |
|||
A new custom message can be created by making a link in the MediaWiki namespace, such as <nowiki>[[MediaWiki:Example]]</nowiki> and editing the page with the text you wish it to contain. You may want to consider protecting the messages you create. Also list any new pages in the MediaWiki namespace in the appropriate page that tracks them. |
|||
====MSG==== |
|||
:Displays a message as the page is rendered, similar to <nowiki>{{NUMBEROFARTICLES}}</nowiki> |
|||
:Example: <nowiki>{{msg:rcnote}}</nowiki> → Below are the last '''$1''' changes in last '''$2''' days. |
|||
====MSGNW==== |
|||
:Same as MSG, except the message is enclosed in <nowiki><nowiki></nowiki> tags. |
|||
:Example: <nowiki>{{msgnw:rcnote}}</nowiki> |
|||
See also [[Help:Template#msgnw]]. |
|||
====SUBST==== |
|||
:Same as MSG, except that the message is substituted as the page is saved, not as it is viewed. So if someone edits the page later on, they will not see the tag in the [[Help:Filling the page|wikitext]], they will just see the message itself. This is similar to the "pipe trick" and signing on Talk pages, see [[Help:Editing]]. |
|||
:Example: <nowiki>{{subst:rcnote}}</nowiki> |
|||
If you want to use a modified version of the standard message, you have to save the standard version first, then edit it, because when applying preview the subst code is not yet replaced by the standard message in the edit box. In the edit summary of the temporary edit you can put "tmp" to indicate that you have not made an error but are still working on the page. |
|||
See also [[Help:Template#subst]]. |
|||
===Backlinks=== |
|||
It is very important to realise that if <nowiki>{{msg:something}}</nowiki> contains a <nowiki>[[wikilink]]</nowiki> then ''"What links here"'' on '''wikilink''' page will '''not''' show the article containing the ''msg'', but ''MediaWiki:something'' instead. This behaviour was requested by editor consensus. |
|||
To see the backlinks to pages using <nowiki>{{msg:something}}</nowiki> you have to use ''"What links here"'' of '''MediaWiki:something'''. |
|||
(This problem doesn't exist when using ''subst''.) |
|||
==See also== |
==See also== |
||
*[[m:Help:MediaWiki namespace/old|MediaWiki namespace in version 1.26]] |
|||
*[[w:Wikipedia:MediaWiki namespace]] |
*[[w:Wikipedia:MediaWiki namespace]] |
||
*[[Message substitution]] |
|||
{{h:f|enname=MediaWiki namespace}} |
{{h:f|enname=MediaWiki namespace}} |
Revision as of 10:44, 13 June 2006
The MediaWiki namespace is one of the 16 standard namespaces in the database structure of the MediaWiki software.
Overview
The MediaWiki namespace is a mechanism allowing administrators to customise or translate the MediaWiki web interface. It is enabled by default in recent mediawiki versions, Template:H:mwg = 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: @ A B C D E F G H I J K L M N O P Q R S T U V W X Y 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 MediaWiki messages is 8, with a corresponding MediaWiki talk namespace 9 to discuss individual messages. Some projects offer templates like en:Template:editprotected (backlinks ) to propose modifications, others have a page like Meta:Requests for help from a sysop or bureaucrat for this purpose.
- Links to MediaWiki messages work like links to ordinary pages, examples:
- [[MediaWiki:Edit]] MediaWiki:Edit,
- [[w:de:MediaWiki:Edit]] w:de:MediaWiki:Edit,
- [{{fullurl:m:MediaWiki:Edit|action=render}} demo] demo.
Each message in the $wgAllMessagesEn
array in Messages.php corresponds to a page in the MediaWiki namespace. For example, there is a line in the php file:
'confirmprotect' => 'Confirm protection',
To this corresponds the page MediaWiki:Confirmprotect, and {{int:Confirmprotect}}
gives ⧼Confirmprotect⧽. When this page is edited the new message is automatically used for say https://meta.wikimedia.org/wiki/Main_page?action=protect. Similarly w:fr:MediaWiki:Confirmprotect has the content Confirmer la protection, 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.
{{MediaWiki:Edit}}
= Edit this page, see m:Template:Ed (backlinks ).{{int:Edit}}
= Edit this page, colon function int: is a shorthand for MediaWiki:.{{int:Erehwon}}
= ⧼Erehwon⧽, but only as far as the message exists.{{MediaWiki:Erehwon}}
= MediaWiki:Erehwon 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 CSS and XHTML markup not permitted on normal pages.
Interlanguage links
Interlanguage links in MediaWiki messages typically won't work as expected. Adding <noinclude> isn't good enough, because something has to evaluate it, as it's the case for messages included like ordinary templates, but not
for messages used internally as system messages.
Instead, one can use in-page interlanguage links on the talk pages, m:Template:ilm (backlinks ) 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