Posts Tagged ‘Wordpress’

WordPress multilingual

Wednesday, March 11th, 2009

I created a category “en” in which i created all the english versions of my categories. I wrote two versions of the same post, in english and german, and left them in the english and german category.  Then i filtered the sidebar menu according to the language category you’re looking at. Looks more or less like this:

<li>
<?php /* Felix Language Switch */ if (is_category(50) || (in_category(50))) {
echo ‘<a href=”http://test.amphibiousthoughts.com”>german version</a>’ ;
} else {
echo ‘<a href=”http://test.amphibiousthoughts.com/news”>english version</a>’ ;
}
?>
</li>

<li>
<?php /* Felix Custom Categories */ if (is_category(50) || (in_category(50))) {

wp_list_categories(‘include=54,55,56,57,58,59,60,61,62&orderby=ID&show_count=1&title_li=<h2>Categories</h2>’);
} else {
wp_list_categories(‘exclude=50&orderby=ID&show_count=1&title_li=<h2>Kategorien</h2>’);
}
?>

</li>

<li>
<?php /* Tags or not */ if (is_category(50) || (in_category(50))) {

} else {
echo ‘<h2>Tags</h2> ‘;   /* Felix Custom Tags */ wp_tag_cloud(‘title_li=<h2>Tags</h2>’);
}
?>
</li>

Drawback of this solution:

Widgets like MyCaregoryOrder wont work and as you can see one language has to do without tags. I haven’t found out how to filter them out yet. Also, you really have to do everything twice. So, after spending 3 days with the wordpress reference finding out how the code works, I decided to use the QTranslate plugin. Installation and handling is as easy as you’d expect from any plugin and it has all the features I was looking for. Thanks :-)


Follow

Get every new post on this blog delivered to your Inbox.

Join other followers: