{"id":52,"date":"2008-09-28T23:55:47","date_gmt":"2008-09-28T21:55:47","guid":{"rendered":"http:\/\/www.viesurip.fr\/?p=52"},"modified":"2009-01-11T20:23:05","modified_gmt":"2009-01-11T18:23:05","slug":"blog-wordpress-multilingue","status":"publish","type":"post","link":"https:\/\/www.viesurip.fr\/en\/2008\/09\/28\/blog-wordpress-multilingue\/","title":{"rendered":"Multilingual WordPress blog"},"content":{"rendered":"<p>This blog uses the WordPress blog platform. All articles are available in French and English, and the interface of the blog is fully translated.<\/p>\n<p>To do this, I use the <a title=\"qtranslate plugin\" href=\"http:\/\/www.qianqin.de\/qtranslate\/\">qtranslate plugin<\/a>. It enables to write easily articles, tags and categories in multiple languages. Default WordPress widgets are also supported.<\/p>\n<h3>Use<\/h3>\n<p>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: <code>[ lang_en]English text[ \/lang_en][ lang_fr]Texte fran\u00e7ais[ \/lang_fr]<\/code><\/p>\n<p>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 <code>__()<\/code> function &#8211; used in WordPress to translate the interface using .mo files &#8211; to translate the strings before they are displayed using the languages tags system.<\/p>\n<p>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 <code>&lt;?php echo qtrans_generateLanguageSelectCode('both'); ?&gt;<\/code> in the header of my template.<\/p>\n<h3>Improvements<\/h3>\n<p>For now, qtranslate doesn&#8217;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.<\/p>\n<p>To do this, I inserted in the header of my template <a href=\"http:\/\/www.viesurip.fr\/wp-content\/uploads\/2008\/09\/messagephp.txt\">the PHP code in this file<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>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 [&hellip;]<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[38,48],"class_list":["post-52","post","type-post","status-publish","format-standard","hentry","category-ce-blog","tag-ce-blog","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/posts\/52","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/comments?post=52"}],"version-history":[{"count":1,"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/posts\/52\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/posts\/52\/revisions\/58"}],"wp:attachment":[{"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/media?parent=52"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/categories?post=52"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.viesurip.fr\/en\/wp-json\/wp\/v2\/tags?post=52"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}