Multilingual Wordpress
To realize a multilingual wordpress you have to follow the following steps:
1. Check if your theme is ready for localization.
To do that open for example comments.php in your theme folder and search for text that is currently displayed on your blog e.g.”Leave a comment”.
If it’s looking similar to
" _e("Leave a comment", "mytheme"); "
then your theme should already be ready for localization.
2. Optional
If not then you will have to wrap the “_e” around every text passage in your theme. Replace mytheme with your theme’s name. Also don’t forget that this has to be inside a php statement!
You can do it like that:
<?php _e("Text", "mytheme"); ?>
Inside a function:
'__('Text', "mytheme")'
e.g.
comments_rss_link(__('Subscribe to the comments via RSS Feed', "mytheme"));
3. Add load_theme_textdomain to your functions.php
This is a very important step because it will load the text via gettext before sending out the headers. Add the following at the very first line of your functions.php inside your theme folder: (if you don’t have one create a functions.php!)
<?php load_theme_textdomain('mytheme'); ?>
