Multilingual WordPress blog
This blog uses the WordPress blog platform. All articles are available in French and English, and the interface of the blog is fully translated.
To do this, I use the qtranslate plugin. It enables to write easily articles, tags and categories in multiple languages. Default WordPress widgets are also supported.
Use
The plugin modifies the administration of WordPress by adding a field for each language for articles, tags and categories. For the rest, you have to use a very simple tags system: [ lang_en]English text[ /lang_en][ lang_fr]Texte français[ /lang_fr]
I use too on this blog many other plugins (for the widgets on the right for example). I had to slightly modify almost all plugins to support the languages tags system. You just need to add a call to the __()
function – used in WordPress to translate the interface using .mo files – to translate the strings before they are displayed using the languages tags system.
To enable users to switch from a language to an other, the plugin provides a widget to display. I rather liked to add the links on the top right of the page by inserting <?php echo qtrans_generateLanguageSelectCode('both'); ?>
in the header of my template.
Improvements
For now, qtranslate doesn’t provide any system to detect the user language. I added on my blog a message that shows below the header if there is a more adapted translation of the blog available for you.
To do this, I inserted in the header of my template the PHP code in this file.