
When releasing a WordPress theme to the public, you have to keep in mind that many persons blogs using a different language than English. WordPress themes can be easily translated, especially using this recipe.

When releasing a WordPress theme to the public, you have to keep in mind that many persons blogs using a different language than English. WordPress themes can be easily translated, especially using this recipe.
The first thing to do is to create a directory called languages in your theme directory.
Then, paste the following lines of code to your functions.php file:
// Make theme available for translation // Translations can be filed in the /languages/ directory load_theme_textdomain( 'your-theme', TEMPLATEPATH . '/languages' ); $locale = get_locale(); $locale_file = TEMPLATEPATH . "/languages/$locale.php"; if ( is_readable($locale_file) ) require_once($locale_file);
At this point, you theme is ready for being translatable. Though, you guessed it, this is not the only thing to do for making your theme available in X different languages.
I'm not going to explain WordPress theme translating on here (Though a Cats Who Code tutorial should be written) so here are two extremly useful articles that you must read if you're interested in the topic:
Thanks to ThemeShaper for the tip!
14 Responses
Where is Russian flag?
Sorry for the flag
There are some plugins that make automated translation, but the quality of translated content is really poor. Surely making, a own translated content is a hard work, but give a much higher quality to your blog.
Maybe is not the best translation, but is impossible to translate it manually, so is very useful. Thanks
I got the point that writer wanna express here. Its absolutely right that a blog should have a language that everyone can understand easily. Because most of the cases visitor see the blog and ignore if it’s in other language..
Nice man.
very usefull, many thanks
Nice tip, and in combination with Google translate it can be very useful.
@seo83,
Your comment are really nice..and i think any website could be a international languade. Keep it up!
thanks for this recipes, so useful.
@catswhocode : if you need help in Albanian language i can help you
Worth to try. I always translate themes manually.
Obviously that’s not enough. At the very least, theme designers should enclose messages to be displayed inside GETTEXT tags and provide a PO file of all the strings used. This should be a condition for a theme to be included in WP theme repository. I’m gonna start a campaign to that effect on the WP forums as I’ve had enough of themes hard coded in English, with no concern whatsoever for other languages! (am French by the way
Trackbacks: