November 04, 2005

MediaWiki, namespaces and multiple languages

I've been trying to setup a multilingual MediaWiki as a single project. However, I've been finding that doing so would probably be a Bad Idea(tm). While this document goes over some of the pros and cons of a single project versus separate projects, it didn't seem to include a number of the ones that I thought were important.

  • If your Wiki is in the English language, then all the markup uses English words. This is fine, if you're only going to have a single language. However, if you use the example in the document above, and are trying to support German and English in the same Wiki, you don't want to force your German editors to learn English just to enter tags! Sure, they can change the language the UI is in, but that doesn't seem to change the markup that the Wiki parser is expecting for each entry.
  • As I mentioned previously, you can create language links (once you modify the database) and this is a Good Thing(tm). However, if you are using the single project approach and have created a German entry for "Foo" it appears as the entry "De/Foo". This is ugly, but livable. However, if you put that entry into a category, when it is displayed in the category it shows up under "D" rather than "F". I would much rather have categories per language.

So, it seems like MediaWiki works great for multiple languages if you use separate projects. Of course, you also have all the disadvantages too.

Posted by rob at 01:38 PM | Comments (0) | TrackBack

Mediawiki and Multiple Languages

I was playing with Mediawiki yesterday. My goal was to create a Wiki with definitions of terms in multiple languages. The only documentation I could find makes it sound like creating language links will be something handled automagically by the wiki.

Unfortunately, this is only partially true.

To enable language links for any given language, the language code needs to have an entry in the database table interwiki (this may be prefixed in any MediaWiki installation with the $wgDBprefix if you defined one at install time). This needs to be done with whatever database editing tools you have.

For example, I added English, French, and Czech as languages by inserting the following rows into my database:

mysql> select * from mw_interwiki where iw_prefix in ('en','fr','cs');
+-----------+-----------------------------------------------------+----------+----------+
| iw_prefix | iw_url | iw_local | iw_trans |
+-----------+-----------------------------------------------------+----------+----------+
| cs | http://www.my.site/wiki/index.php?title=cs/$1 | 1 | 0 |
| en | http://www.my.site/wiki/index.php/en/$1 | 1 | 0 |
| fr | http://www.my.site/wiki/index.php/fr/$1 | 1 | 0 |
+-----------+-----------------------------------------------------+----------+----------+
3 rows in set (0.01 sec)

I made the "cs" entry different, mimicking something I saw on a TextBook page, but all the entries appear to do the same thing. When you click on any of the language links, it takes you to a page named, "http://www.my.site/wiki/index.php/Cs/wiki-term"

Posted by rob at 09:00 AM | Comments (0) | TrackBack

November 02, 2005

Gallery 2 hacking

I was trying out Gallery 2 yesterday and realized that while it supports Captcha, it doesn't support it for anonymous comments out-of-the-box.

I managed to hack my copy to almost work, so I put my patch on the Gallery forums.

Posted by rob at 01:02 PM | Comments (0) | TrackBack