Translation with POEdit - Internationalize / Localize WP Themes Guide -Part 3

Now that you made your theme translatable, let's do the necessary to translate it.

For that you will have to use a translation software, in this guide we'll use POEdit, so go ahead and download then install it.

We will use POEdit to create a PO (Portable Object) file which will contain all the translatable words & phrases and optionally their translation for a specific language. If you add a translation to the PO file, you can setup POEdit to create a MO (Machine Object) file, which is the machine-readable file (the one we need to upload to the server with the theme).

Note: PO files have .po extension & MO files have .mo as extension.

In this guide we will create the MO file in one go with the PO file for a specific language:

Launch POEdit & before anything else make sure it will automatically save a MO file every time we make or modify & save a PO file: Go to File > Preferences..., in the Preferences box choose the Editor tab, under Behavior see if "Automatically compile .mo file on save" is checked, check it if not.

Now let's start making the PO file, go on File > New Catalog...

A box will pop-up with 3 tabs:

The first one (Project info) is for general information, enter utf-8 for "Source code charset" & you may want to give your project a name (theme's name maybe). Fill the other fields if you wish ...

The second tab Paths is to give POEdit the path of your theme's directory (on your hard drive), bad thing is that you can't just click on browse & find the directory of your theme. To get the path, use Windows Explorer, browse till you enter your theme's folder then copy the path from the Address Bar, the path may look a bit like this:

C:\Documents and Settings\Something\Desktop\theme-directory

Click the "New item" button (graphic icon of a little square & star), a field will be created, paste in your path & hit Enter.

Go to the third tab named Keywords, there you tell POEdit about the two GetText functions "_e" & "__". Click the "New item" button, a field will be created, type in "_e" (without the quotes), press Enter then click again on "New item" & type "__" (2 underscores without the quotes). Hit Enter again then click on OK. You'll be asked to give your catalog (PO file) a name, since we'll use it for a specific language, use the two letters ISO Code of that language, for example "ar" for Arabic or "fr" for French (without the quotes). A long list of ISO codes here on Wikipedia. Once the name given click on OK.

Note: POEdit will create a MO file named just like your PO file (ar.po & for example).

If you did everything correctly, POEdit should start scanning the theme's files then show you a box with the results, click on OK.

In POEdit now you can see three rows:

The first one has two columns, one for original strings, the ones in the theme's files that you wrapped in the second step, the second column is for translation, would be empty still. In this first row you can click & select the strings you want to translate (or change translation later).

The second row shows the original string selected in the 1st row (not editable).

The 3rd row is where you will enter the translation for the string selected.

You know what to do now, make your translation for each string then when finished save your catalog (File > Save or Ctrl+S).

What if for some reason you decided later to modify the strings to translate, create new strings or delete strings? (by editing the PHP files of the theme)

After you edit the files, POEdit allows you to update the translatable strings: Open your PO file then go to Catalog > Update from sources, POEdit will scan the files again & pop-up a box with a list of "New strings" & a list of "Obsolete strings" (the one that you may have removed), you click on OK to update the catalog.

OK, now rest to upload the theme to the server with the MO file included in the directory. Make sure you use Wordpress translated to the same language, most likely you will find it in the WordPress in Your Language page.


  1. I've followed these posts and others I've found on the subject but always run into an issue of Wordpress not rendering or finding my MO file. I do not no where to put the MO file so the load_theme_textdomain() can find it? Can you outline the directory structure of wordpress, your theme and where the MO will go in each?

  2. Hi, damn sorry for the late reply, being too busy,

    For the WP core MO should be here:

    / public_html / your-site-folder / wp-content / languages /

    You have to create that languages folder

    Actually for some reason the is working for me but not, didn't have time to try to solve that

    For the MO of the theme, should be in the theme's directory:

    / public_html / your-site-folder / wp-content / themes / your-theme /

    I'm using the Language Switch plugin & all languages work fine there.

  3. Bookmarks about TranslateJanuary 30, 2009 at 12:00 PM

    [...] - bookmarked by 1 members originally found by kevjumba15 on 2009-01-01 Translation with POEdit - Internationalize / Localize WP Themes ... [...]

  4. Let Me Go @ High Speeds « Alexander’s Blog - The Making of LetMeGoMarch 14, 2009 at 5:37 PM

    [...] activated the use of .mo files (instead of .po) for the internationalization [...]

  5. Hi!

    Nice tutorial and also very clear.

    I have followed the steps from the first to the end but I can't see the theme translated. I don't know where to start searching for some error.

    Any ideas?


  6. it seems that it has something to be with the fact that I am using multiuser version.

    Anybody has any idea?

  7. A good tutotial
    But like Jason says, I as well often find Wordpress not rendering or finding my MO file.

  8. @Jason Darrow
    You will need to edit the wp-config.php file to define the WP_LANG constant for the language you want wordpress to use, apart from having the language files as MuMu said.

    Try renaming to and see if that works.


  9. Tutorial para criar seu tema com internacionalização | joaobarroca.NetApril 11, 2010 at 6:54 AM

    [...] Parte III [traduzindo com Poedit - já temos outro tutorial aqui mesmo] [...]

  10. Your defining work of localization and internalization really sets me up on the work.

    Great guide.

  11. Tweets that mention Translation with POEdit – Internationalize / Localize WP Themes Guide – Part 3 | Gettin' Geek -- Topsy.comMay 8, 2010 at 2:29 PM

    [...] This post was mentioned on Twitter by sheldonrampton. sheldonrampton said: How to do a language translation project with Poedit: [...]

  12. Let Me Go @ High SpeedsJune 3, 2010 at 9:31 PM

    [...] activated the use of .mo files (instead of .po) for the internationalization [...]

  13. If you plan to drink this detox drink on the day of the drug test, try starting your regime a few hours earlier. Abstaining from weed and drinking detox drinks are known to bring great results, but if you are a chronic smoker, you might want to consider a few extra tips to avoid any trouble: Even though abstaining from cannabis and a toxic environment is highly recommended, some consumers are reported to have tested negative just by drinking the Mega Clean Detox drink even while smoking pot. This goes to show how the test results vary from person to person and the efficacy of this detox drink truly depends on many external factors too. If we talk about difficulty levels, passing a urine test is relatively easier than passing a blood or saliva test. Make sure you properly investigate any shampoo you're contemplating to verify that it adequately removes drug residues from your hair. Online user reviews and product descriptions can be extremely useful sources of information.


Post a Comment

Popular posts from this blog

Quick Review: Choose the Best Classified Script For Your Needs

Making it Translatable - Internationalize / Localize WP Themes Guide -Part 2