While I was installing MediaWiki for my research group over the last
couple of weeks, I was struck by how inappropriate some of the interface
text is for an "out of the box" MediaWiki installation. I hacked away at
Language.php for a while attempting to fix this, but then I realised:
Language.php isn't just the MediaWiki default, it's also the default for
new Wikipedias.
Well, it turns out I'd already written most of the code to fix this
situation, some time ago. A copy can be made of the MediaWiki namespace
of a wiki using dumpMessages.php. And InitialiseMessages.inc had some
untested support for reading in such files. The idea was to use the
interface text from the English Wikipedia as the default for new
Wikimedia wikis.
To do this, first I had to generalise the text in the MediaWiki
namespace, using tags such as {{PROJECT}} and {{localurle:}}. This
allows the resulting dumped language file to be used for other projects,
where the namespace names or even directory structures might be different.
This worked just fine, and I dumped the file and committed it to CVS. I
also dumped the MediaWiki namespaces of a few other languages, but I'm
not sure if they have been generalised in the same way as the English one.
I then initialised the new
kw.wikipedia.org with the text from the
English Wikipedia. This also appears to have worked just fine.
I haven't yet written code to allow MediaWiki to load one of these
language files at run time, but I do plan to do so. When that's done, we
could theoretically remove the $wgAllMessagesXx arrays from the
LanguageXx.php files.
-- Tim Starling