Remember this post?
http://mail.wikipedia.org/pipermail/wikitech-l/2003-September/005988.html
You all thought I was just daydreaming didn't you? heheheh :)
I have implemented a feature whereby almost all text messages in MediaWiki can be edited through the web interface. It is in CVS, and in my directory on larousse:
http://test.wikipedia.org/w/tim/wiki.phtml?title=MediaWiki:All_messages
I've sent this to both wikitech-l and wikipedia-l. Hopefully it's not too technical for wikipedia-l.
Features --------- * wfMsg now checks the database for a page in the MediaWiki namespace, by the same name as the message. If it finds it, it loads it. If it doesn't, it falls back to Language.php * Reasonably efficient (more on this later) * The install script automatically creates articles for all the messages existing in the language file. By default, all these articles are protected. There are myriad security problems associated with allowing anyone to edit any message. We will unprotect the ones which we decide are safe. * The UI is [[MediaWiki:All messages]], which is created by the install script. It contains a table with all the message names, edit links for each one, default text and current text. * To make the "current text" column possible, I have added an extra markup entity: {{MSGNW:recentchangestext}} will be replaced with an escaped version of that message as the page is rendered. {{MSG:recentchangestext}} is the unescaped version. * While I was at it, I added a frivolous crowd-pleasing feature: {{SUBST:xxxx}}. This tag is replaced by the given message as the article is saved, just like ~~~~ signatures. Hence someone could easily create a [[MediaWiki:Stubwarning]] article, and then append {{SUBST:stubwarning}} to the bottom of a stub article, which would automatically be expanded to the standard stub boilerplate when the user clicks "save". * The wfMsg behaviour is controlled with $wgUseDatabaseMessages, and is off by default. The substitution tags cannot be turned off at this point in time.
Caveats --------- * No handy "edit this page" link on special pages just yet * There's a minor problem with message names that have spaces in them. No big deal. * The new namespaces (there's a MediaWiki_talk as well of course) don't show up in the power search yet
Efficiency --------- * Two cache levels: - a per-thread cache in a PHP static variable. This is mainly for the benefit of wfGetDB, which gets the "noconnect" and "nodb" messages every time there is a query. - memcached (untested). My use of memcached is documented in memcached.doc * I have written in DefaultSettings.php that use of this feature is not recommended unless memcached is installed. If memcached turns out to be too slow for this application, we can always use shared memory. * The time required for substitution tags should be insignificant.
The main motivation for this feature is to allow other-language wikipedias to translate their interfaces more easily. However, there are also gains for en:, since we can use these pages in a way similar to the way [[Wikipedia:Recentchanges]] is used.
Note that my previous attempt at implementing something like this, involving putting colons at the start of messages, has been deleted.
-- Tim Starling <tstarlingphysicsunimelbeduau>
wikitech-l@lists.wikimedia.org