Translating WordPress themes is actually very easy. Yes, no matter who you are, no matter what you do, no matter how much computer knowledge you poses, you can translate a WordPress theme. It’s real easy and now with the help of some screenshots and some simple guidelines you’ll have your theme translated in no time. So without further ado let’s get on with it.
Step 1 – Download Poedit
While there are other programs as well, for the sake of clarity and simplicity we’ll just go with the one we use – Poedit. It’s free and you can download it from here. Then install it. That’s easy too. Just click next. Then … next. Then finish. And you’re done.
Step 2 – Find the Pot… file
The .pot file contains all translatable text from a theme and should be provided by the theme’s authors. Check to see if the theme in question has a /languages/ folder. If it does look inside it and and you should see the .pot file right there. If not, you could ask the theme authors to give it to you, but if they’re @#$@#s about it you can create it yourself from the theme files. There’s this simple tutorial from WordPress on how to create a .pot file.
By the way, all our WordPress themes have a .pot file in the /languagesfolder. So no need for all that.
Step 3 – Translate the theme
- Open up Poedit
- Go to File -> New Catalog then select the .pot file
You should name the files according to your language code. Have a quick look here to see your language code. Type the language code and click save.
Finish all your translations and save. Both the .po and .mo files should be created now.
4. Tell WordPress to use your new language files
If the theme has a /languages/ folder (and Mantra does) upload both the .mo and the .po files there. Check once more that they are named accordingly.
Now go back to your WordPress dashboard >> Settings >> General and select your language.
5. You have learned how to translate a WordPress theme
There isn’t really a step five unless you want to consider tapping yourself on the back and congratulating yourself on a job well done as a step. The theme is now translated and you can check it out. Go ahead, take a look at your new translated theme and verify that your new text looks good and matches context both on the live site and in the theme settings page (if the theme has such a page and all our WodPress themes do).
If you reached step 5 and you’re not clapping your hands in joy, leave a comment below and we’ll guide you there.
PS: To avoid all the off-line file editing, one can use the Codestyling Localization plugin and do the actual translating straight from inside the WordPress dashboard. See how in our follow-up tutorial on how to translate a WordPress theme II.
As the previously suggested plugin from part II is no longer available, we’ve written a part III to our translations tutorial. This procedure does not require you to play with files (too much) or install programs. All you need is the Loco Translate plugin for WordPress.