Уикипедия:Именно пространство МедияУики: Разлика между версии

Изтрито е съдържание Добавено е съдържание
мРедакция без резюме
олекотяване
Ред 1:
The '''MediaWiki namespace''' is a mechanism allowing non-[[:en:Wikipedia:developers|developers]] to customise or translate the [[MediaWiki]] web interface. Each message in the <code>$wgAllMessagesEn</code> array in [http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/<code>Language.php?rev=1.78&view=auto Language.php]</code> now corresponds to a page in the MediaWiki namespace. For example, the whole content of the page [[:en:MediaWiki:Fromwikipedia]] is "Fromfrom Wikipedia, the free encyclopedia.", the message which is displayed at the top of each page of the English Wikipedia. When this page en:MediaWiki:Fromwikipedia is edited the new message appears automaticallyavailable at the top of every page of the English Wikipedia. Similarly [[:fr:MediaWiki:Fromwikipedia]] has the content "Un article de Wikipédia, l'encyclopédie libre." (note that the page name iself is not translated).
 
<!--За повече информация вижте [[meta:MediaWiki_namespace]].-->
 
Due to the special role these pages have, the usual interlanguage links have to be dispensed with.
 
Messages (using Meta Wikimedia as an example):
 
* [[Уикипедия:Съобщения в именно пространство MediaУики]] -- a big table of edit links, default text and current text
Line 11 ⟶ 7:
* [[Уикипедия:Незащитени съобщения в MediaУики]] -- a list of unprotected pages
* [[Уикипедия:Собствени съобщения в MediaУики]] -- a list of custom messages
 
==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 the text of the links in the sidebar
* A few messages can cause the software to stop working if they are changed, for example [[MediaWiki:Linktrail]].
 
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.
 
 
==Items not included==
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 names
* A number of items in [[Special:Preferences]]
 
To view these text strings, see [[meta:Locales for the Wikipedia Software]].
 
==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:Votes for deletion|VFD]] notices and [[:en: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> &rarr; {{msg:rcnote}}
 
===MSGNW===
 
:Same as MSG, except the message is enclosed in <nowiki><nowiki></nowiki> tags.
 
:Example: <nowiki>{{msgnw:rcnote}}</nowiki> &rarr; {{msgnw:rcnote}}
 
===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 wikitext, they will just see the message itself. This is similar to the "pipe trick" and signing on Talk pages, see [[Wikipedia:How to edit a page]].
 
: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.