Help:MediaWiki namespace

From GM Wiki

Jump to: navigation, search
MediaWiki Handbook: Contents, Readers, Editors, Moderators, System admins +/-

The MediaWiki namespace is one of the 16 standard namespaces in the database structure of the MediaWiki software.

Contents

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, $wgUseDatabaseMessages = 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 w:en:Template:editprotected (talk, backlinks, edit) 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 Confirm protection. When this page is edited the new message is automatically used for say http://wiki.3400z24.com/index.php?title=M: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, see Template:Ed (talk, backlinks, edit).
{{ int:Edit}} = Edit, parser 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 (unclear) for messages used internally as system messages.

Instead, one can use in-page interlanguage links on the talk pages, Template:ilm (talk, backlinks, edit) 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

Template:Ph:MediaWiki namespace

Links to other help pages

Help contents - all help pages
Meta | Wikinews | Wikipedia | Wikiquote | Wiktionary | commons: | mw: | b: | s:
Versions of this help page (for other languages see below)
Meta | Wikinews | Wikipedia | Wikiquote | Wiktionary
Reading
Go | Search | Stop words | URL | Namespace | Page name | Section
Backlinks | Link | Piped link | Interwiki link | Redirect | Category | Image page
Logging in and preferences
Logging in | Preferences | User style
Editing
Advanced editing | Editing FAQ | Editing toolbar | Export | Import
Editing tips and tricks | Editing shortcuts
Tracking changes
Recent changes (enhanced) | Related changes | Watching pages | Diff
Page history | Edit summary | User contributions | Minor edit | Patrolled edit
Style & formatting
Wikitext examples | Wikitext reference | Reference card
HTML in wikitext | HTML elements
List | Table
Special input and output
Inputbox | Special characters | Displaying a formula |Images and other uploaded files | EasyTimeline
Advanced functioning
Template | Advanced templates | Parameter default | Variable | Magic word | Substitution | Array | Calculation
Page management
Starting a new page | Renaming (moving) a page | Maintenance | Merging and moving pages | Protecting pages
Resolving disputes | Deleting a page
Special pages
Talk page | Testing | Sandbox
Lists of resources
Categories | Lists of Categories | Copyrights | Infobox
Redirect | Reference Desk | Shortcuts | Stub types

Other languages: Template:H-langs:MediaWiki namespace

Views
Personal tools