Creating a .po Translation File

I used to rely on these instructions whenever I needed to create a translation file for WordPress; but Poedit has gone through some updates since those were written, so they don’t necessarily match up to the current version of the software now. So, I came up with my own updated set of instructions to accompany the newer version.

Note: I’m currently using the free version of poEdit, so that’s the version on which these instructions are based.

  1. Start Poedit, then select File → New.

  2. Choose your desired Language of the translation, then click OK.

  3. Click Extract from Sources. In the dialog which appears, the Sources paths tab should be selected by default. If not, select it.

  4. Click the New Item icon (i.e., the second one, which looks like a little square), then enter the path to the directory containing your source files; for example:

    /Users/girlie/Documents/theme-name/

    and press enter to save the new path.

  5. Select the Sources keywords tab, then click the New Item icon (again, the one which looks like a little square).

  6. Enter __ (that’s underscore underscore), then press enter to save the new keyword.

  7. Click the New Item icon again.

  8. Enter _e (that’s underscore e), then press enter to save the new keyword.

  9. Select the Translation properties tab, and enter your desired Project Name.

  10. For Source code charset, select UTF-8 (recommended).

  11. Enter any of the other details you wish to complete (but do not change any pre-existing settings or values unless you know what you’re doing); then click OK.

A new window should display, which summarizes the list of strings that were found to translate, based on the supplied keywords (__ and _e).

Choose File → Save, give a name to your .po file (ex., theme-name.po), and save it.

Now, you can either proceed with your own translations, or exit poEdit if you were just needing to create a master translation file for later use (or distribution).

Comments on this entry are closed.