How to Translate WordPress Themes That Come Without Languages Files

Translate WordPress Themes
JavaScript for WordPress

Have you ever downloaded or bought a theme and found it not translated into the language you need? Many theme developers don’t translate their themes, or maybe only to a couple of languages. In this guide, we will show you how to translate WordPress themes into any language.

Translate WordPress Themes Process

The steps you need to translate WordPress themes can be summarized in:

  1. Scan the theme files for texts
  2. Create the language files
  3. Place the language files in the right place

Important Note: Themes must be properly internationalized. In other words, they must be <Translation Ready> so that you can translate them to the language you want.
All themes in our Multilingual Themes directory are ready for translation, check them now!

1. Scan the Theme Files for Texts

The first step in the process to translate WordPress themes is to collect the text strings from your theme. You can do it by using a free software Eazy Po and following the instructions below.

When you download Eazy Po, open EazyPo.exe and click on “Extract messages from source code

Eazy Po Extract messages from source code

This will open a new window, click on Browse Folder and then select your theme folder.

Eazy Po Select Folder

Then, click on Build, choose where you want to save the output file and click on “Execute command“.

Eazy Po Build

Here you go! Now you have all the theme’s text strings in one POT file. The next step is to create the language files for the language you want to translate the theme into.

POT – Portable Object Template: The file that contains texts from your theme or plugin that you will translate.

Don’t start translating the texts now, POT files are not meant to have translations. Save the POT file untouched.

2. Create the Language Files

The language files you need to create are

  • PO – Portable Object: This is the file you will create when you translate the POT file we created above.
  • MO – Machine Object: It’s the machine-readable version of the PO file

2.1 Create PO File

Open EazyPo.exe and then choose “Open a catalog file” and select the POT file.

Open a catalog file

Click on File -> Save as and save the PO file.

Create PO file

Once the file is saved, Eazy Po will load the PO file. Now it’s the time for the translation. Start translating the texts to your language as shown below.

Translate PO files

Note: PO files are very important because you can use them to edit the translations anytime. So you can save the PO file with the name of the language, for example fr_FR.po

2.2 Create MO File

When you are done with the translations, click on Catalog -> Create MO File.

Create MO Files

The MO file contains the same data from the PO file but compiled to the machine language that WordPress can read.

3. Place the Language Files in the Right Place

Now, you have successfully created the MO file. In order to make WordPress read that file you have to

  • Rename the File: The MO file name should look like {theme-text-domain}-{locale}.mo. The theme’s text domain is the value of Text Domain in your theme’s style.css file.
    Theme Text Domain
    If it does not exist, you can use the theme’s folder name to replace the text domain value.
    Where the locale is your language code. To get the right locale of your language, check this page under WP Locale column.
    Examples of the right naming of MO files: twentysixteen-fr_FR.mo, divi-ru_RU.mo, avada-ar.mo
  • Place it in the Languages Directory: Move your MO file to wp-content/languages/themes. If it does not exist, create it.

Conclusion

We have used Eazy Po to create the language files, it’s very easy to use. Another great software could be POEdit, however, it does not offer the feature to create POT files for free.
We hope that you are able now to translate WordPress themes into any language you want. If you have any questions, please feel free to use the comments section below.

GET MORE STUFF 
IN YOUR INBOX
WordPress Multilingual, Performance, SEO, Reviews and HOT Deals. One email per week!
Stay Updated
Give it a try, you can unsubscribe anytime.
Close
GET MORE STUFF
IN YOUR INBOX
WordPress Multilingual, Performance, SEO, Reviews and HOT Deals. One email per week!
Stay Updated
Give it a try, you can unsubscribe anytime.
We have created the 1st online directory for the Multilingual Themes
CLICK HERE

WE'RE SOCIAL!

Follow us on..