This is day 7 of my WordPress Developer Advent Calendar.
I was very happy to see that a new version of Poedit was released recently. But what really made me smile was the new PRO version with built-in support for translating WordPress themes and plugins. As soon as I saw the Tavern post announcing the new version, I got myself a PRO license. I then ran it through it’s paces to test how easy it was to translate a WordPress plugin. It now literally a few minutes to make your plugin translation-ready, and is a vast improvement over previous versions of Poedit. Here is a quick walk-through:
- Download and Install Poedit.
- Upgrade to PRO ($19.99) and enter your license key. Close and reopen the app.
Choose the option “Translate WordPress theme or plugin”
- Choose the folder of your WordPress plugin
Poedit extracts the translatable strings from your plugin files:
- Choose the language you want to translate to.
- Go through every string in the list and make your translations.
- Save your .PO translated file to your language folder of your plugin.
- DONE! Move onto next language…
Before You Translate
- Make sure you use translatable strings in your plugin. For example, use __(“My plugin is cool”), rather than just plain “My plugin is cool”.
- In your plugin header, make sure you specify a “Text Domain” and “Domain Path” properties. If you are unsure how to do this, check out the WordPress Plugin Boilerplate header.