As you can, see some of my posts have an English and Spanish version that is loaded according to your browser’s default language or by clicking on your language flag from the right sidebar. You might think it’s some kind of auto-translate function provided by Google or Yahoo’s Babel Fish, but it’s not.
qTranslate plugin
I use a plugin called qTranslate by Qian Qin, which let you write as many versions as languages you had set. In my case, I have Spanish as my primary language and English as the second one, so when I post something new I write two version (although I tend to write the post in English first and later translate it to Spanish).
What about auto-translating?
qTranslate is not an auto-translate plugin because it ‘s aimed for those who know how incoherent a translator could be (Google and Babel Fish, not offense!).
Translating your whole blog
If your theme a .po file (language file) according to the current displayed language, almost everything will be translated. Things like your blog’s title or description, other plugings and widgets might not work because they don’t use the special __(“string”) invocation.
To fix that in plugins and widgets just replace the output variable. For instance, if you have a return variable like $output, change it to __($output). For your blog’s title and description you have edit your theme. As an example, to translate my blog’s title I changed:
<h1 id=”title”><a href=”<?php bloginfo(‘url’); ?>”><?php bloginfo(‘name’); ?></a></h1>
for this:
<h1 id=”title”><a href=”<?php bloginfo(‘url’); ?>”><?php if(qtrans_getLanguage() == ‘en’):?>Luis’ Blog <?php else: bloginfo(‘name’); endif; ?></a></h1>
References
- http://wordpress.com
- http://www.qianqin.de
- http://www.qianqin.de/qtranslate/forum/viewtopic.php?f=3&t=294

Planeta Linux
Follow me