Using Poedit to Translate Your WordPress Plugins
Over the last weeks, we've started to get more and more requests for translations of PublishPress plugins.
As a team, we speak English, Spanish, Bulgarian, Croatian, Russian and Brazilian Portuguese.
That's a pretty good list, but it only goes so far. What about French, German and the other popular languages that our users want?
Fortunately, we've stumbled on an excellent tool called Poedit which has been a big help in translating plugins. This is a big help because WordPress translations can be very inconsistent.
Before you begin
It's worth checking to make sure your plugin or theme really can be translated. These tutorials will help you:
Translating a plugin with Poedit
Here's an introduction to how Poedit works.
- Start with a copy of your plugin files. For this translation example, I'm going to use UpStream, a project management plugin, as an example. Click here to download the latest version of UpStream.
- Download Poedit from poedit.net. They offer Mac, Windows and Linux versions.
- Run the Poedit installer on your desktop.
- Click “Create New Translation”.
- Select one of the existing .po files from your plugin's /languages/ folder. In this example, I'm choosing an Australian English file.
- Choose the language for your translation:
- On the left-hand side, you will see a list of all the English translations. On the right-hand side there’s a blank space waiting for your translation:
- At the bottom of the screen, you can enter your translation text into the “Translation” field:
- So far so good, but here's what Poedit really stood out for us. It has automatic suggestions, based on what other users have chosen. In this example, it suggests “Teléfono” as the translation for “Phone”. You get 10 free suggestions. If you pay $20, you get unlimited suggestions. This means we can get a translation is 95% accurate. Any PublishPress or EmbedPress user can then suggest improvements.
- Once you've completed translating all the strings, you can export your file:
- Poedit will export both a .po and an .mo file. You will need both of those files.
- Place these in your /languages/ folder using the naming structure you can see below. You can find a list of locale identifiers here.
- If your WordPress site is running your language (in this case, Spanish), your plugin will automatically detect your new files and display in your language:
Hopefully this is a helpful guide to get started with translating WordPress.
If you just want to translate one or two words across your site, consider using the Real-Time Find and Replace plugin.