For WordCamp UK 2009, we’re having a dual language site (currently in the works, but hopefully near completion soon), where the content will be available in English or Welsh (as our host city is Cardiff). I had a scout around the various multi-language plugins, and none of them really seemed to hit the spot (mostly because there seemed to be too much UI jammed onto the screen), so I’ve decided to go with WordPress Mu running with a sub-directory for each language.
Laura and I have been careful to ensure that the theme is translation friendly, using the __()
and _e()
functions to provide WordPress i18n. The slight headache just now came when I needed to make the admin area of the Welsh blog display in Welsh. Googling around sent me into various blind alleys, but the solution was as simple as you’d hope from a WordPress project:
- Install the WordPress .mo language file into wp-content/languages/lang-code.mo
- In the admin area of each blog go to Settings > General and at the bottom you will find a “Blog language” option (if it’s not there, or the languages seem incomplete, check your .mo files are in place); simply select your language, save the options and (bam!) your blog admin is completely translated. You’ll also see that the front end theme has been set to the language of your choice, the least that this will to is change the language code at the top of the HTML source, and if the relevant translation files are in place for that theme then the theme will appear in the relevant language. Now all you need to do is make sure your content is in the right language!
To set the default language for any new blogs, go to Site Admin > Default Language and make your pick.
One of the blind alleys I went up was talking about the WPLANG constant in wp-config.php, this is pretty irrelevant to WordPress Mu, just drop in your .mo files and go to the settings page for each blog.
Hope this helps someone, feel free to ask any questions in the comments and I’ll do my best to answer them from my limited knowledge.
Leave a Reply