FrugalWebGuy is Merging with Michael Mann Web Design under the new Title of I Do Web Work

Plugin Translation Using POedit

Video Available (Signup to Access - Members Only)

So you have developed a plugin (or theme) and now create a translation file? I embarked on this journey and decided to use a program called POEdit. I would not be writing this training except that most of the training out there does not focus on changes made in the release of version 2 of the program. Things have changed and frustration is guaranteed if you follow most of the instructions on the Internet. Let's begin.

The first thing is you will want to install POEdit. If you are working under Ubuntu Linux as I am, you can install from your favorite package manager or use sud apt-get install poedit from the command line. Otherwise, grab the program from their website. Once installed and open, you will see this screen.

POedit Main ScreenFrom the File menu, select New. This will present a new window to select the language for this translation file.

POedit Select Language

Select the language from the dropdown menu and click Ok. Then click Save from the top left area of the main window. Navigate to where the plugin is located locally and save the file there.

Note: The file will default to a .po extension. Be sure to replace that with .pot before saving.

Click Extract from sources. This will open the Catalog Properties window, which is where most of the other training out there wants us to end up at, but they unfortunately focus on versions before version 2 of POedit, which changed the interface.

POedit Extract from sources

There are three (3) tabs in the Catalog Properties window and we will go through each of them. The first is Translation Properties. Here you will want to enter at least a name for the project. The rest of the preselected choices should work, but are fully changeable.

POedit Catalog Properties - Translation Properties Tab

For the Sources Paths tab, under the Paths area click the green plus sign and select Add Folders... This should open the folder location of the plugin.

POedit Catalog Properties - Source Paths

For the Sources Keyword tab, under the Additional keywords area locate the New item icon (second from the left) and add two separate keywords: __ and _e.

POedit Catalog Properties - Sources Keywords

Once you are done with the three tabs, click OK. This will open the translation file, showing the translatable items and allow you to provide the translations.

POedit Translation File