How to translate a WordPress theme

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. If they’re @#$@#s 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 Mantra has a .pot file in the languages folder. So no need for all that.

 

Step 3 – Translate the theme

    1. Open up Poedit
    2. Go to File -> New Catalog then select the .pot file

Open the pot file

    1. A new window will pop up asking you some information. It’s all optional so fill in what you’d like then click OK.

Enter Poedit translation info

    1. Yet another window will ask you where and with what name to save your new .po and .mo files.

Enter language code for your translation

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.

    1. All the text to translate should be visible now.
      Poedit text to translateClick on all the texts one by one and at the bottom of the screen you’ll have a field where to type your translation.

Translating theme text

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 to the root folder (main directory) of your WordPress installation and look for a file called wp-config.php.

WordPress main directory and wp-config file
Open it then look for this particular line:
define ('WPLANG', 'en_EN');

You should change the en_EN (or whatever code you find) with your language code. For example if you translated to french and your language code is fr_FR then that code should be:

define ('WPLANG', 'fr_FR');

Save and close the file.

 

5. Yoyos havanos justos translatido uno WordPress thema!

There isn’t really a step five unless you wanna 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 Mantra does).

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 WordPress dashboard.

About Kay

The creative mind behind Cryout Creations. In charge of all you see and a lot more. Has all the great ideas but never enough coffee to make them all happen; also the lead bug designer.
Tagged , , , . Bookmark the permalink.

15 Responses to How to translate a WordPress theme

  1. Guest says:

    Why this tutorial bypassing issues caused by fonts? How to use them in order to display characters which are specific for latin-extend?

    • Zed says:

      Fonts are more of a browser/system issue than a WordPress issue. WordPress does its job very well with using the proper featured that exist in current browsers for international character support.
      However, it can do very little to support obsolete software (like old browsers on/or old operating systems). For those specific, independent workarounds need to be implemented. Custom fonts is just one workaround.

  2. Dana says:

    Does the presentation page now accept translations? I am needing French and Spanish.

  3. Dupont Michael says:

    For Tempera theme, there is a problem : _tempera-fr_FR,mo, fr_FR.mo, tempera-fr_FR.mo… in languages directory : no translate. help please ?

  4. Marce says:

    Hi ! The problem i have is that my website can be seen in 2 languagues, the default english and when the people presses the spanish flag it shows the spanish translation using Mealingua. But the THEME appears in English!! HOW do i translate this THEME to spanish only for the people redirected to that translated page??

    • Zed says:

      It really depends on the plugin you use. Plugins should take care of switching WordPress to the correct language depending on what the visitor is seeing.
      Both Mantra and Parabola have Spanish translations, so if you also add the WordPress translation, the plugin should do the rest and you should see the correct strings on site.

  5. Harro says:

    How can I be sure that nobody else is already translating a theme into the same language as I intend to do? It’s a waste of time to translate it twice. For me, but also for that other person.

    • Zed says:

      If you mean one of our themes, check the Translations pages to see what languages it is already translated into (sometimes we post translations on the site before we include them in the themes).

      Other than that, there’s no way to know if somebody is working on a translation at this exact time.

  6. Marly says:

    Very nice! But instead of translating info about content (such as the names of various navigation elements), I’m looking to do something a little different, i.e. I need to translate some page content.

    I use WPML to manage my translations, and this seems to be compatible with most of the Mantra theme. However, I don’t see a place where I can translate the presentation page (translate text columns, put in slides with translated text, etc.). Any advice? Thanks, Marly

  7. Do Xa says:

    Now that’s a good tutorial. You should know that it’s also possible to use this online tool to easily translate WordPress themes – https://poeditor.com/ There’s even a plug-in you can download to speed up the file management process, which integrates the POEditor API to the WordPress account – http://wordpress.org/extend/plugins/poeditor/ I highly recommend it.

  8. Mike 'Cookie Man' D. says:

    Ah…the light just turned on. I was wondering how to do this. Thanks for sharing this!

  9. Andrzej says:

    Hah this article is very fine! Humble step 5 approved. Thank you for sharing usefull knowledge.

Leave a Comment