28 September 2008

Multilingual Wordpress blog

[lang_fr]Drapeaux multicolores dans un temple à Darjeeling en Inde[/lang_fr][lang_en]Multicolor flags in a temple in Darjeeling, India[/lang_en]

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.

3 Comments »

31 May 2008

Hello world

As I write this article, this blog isn’t yet available online.

With this blog, I intend to create a place where I will present my projects, present myself, and discuss with the persons interested in my projects.

Translation

This blog is available in English and in French. I first write my posts in French, then I translate them into English. As I don’t know English as good as I know French, and as I am sometimes lazy, the english version is likely to be less complete and contain more errors than the french one. However many of my projects can be interesting for non-French speakers, thus I will always at least write a biref of my posts in English.

I would like to translate this blog into German in the future, but for now it seems too complicated to me. I hope a stay in Germany in the near future will help me with this task :) .

To come

As this blog is yet new and empty, I will begin to migrate my most important present and past projects here. These projects will be the topics of my next posts.

No Comments yet »

  • Welcome!

    I write on this blog about my projects, my practices and my discoveries in the domains of the internet, networks and computer science.

    Tristan, French student in TELECOM Bretagne, a "grande école" specialized in telecommunications

    Contact me Twitter Facebook

    Read more »