Themergency fooplugins.com

Translate Your Plugins With Poedit Pro

| 3 Comments

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:

  1. Download and Install Poedit.
  2. Upgrade to PRO ($19.99) and enter your license key. Close and reopen the app.
  3. Choose the option “Translate WordPress theme or plugin”
    poedit-homescreen

  4. Choose the folder of your WordPress plugin
  5. Poedit extracts the translatable strings from your plugin files:
    poedit-extract-strings

  6. Choose the language you want to translate to.
  7. Go through every string in the list and make your translations.
  8. Save your .PO translated file to your language folder of your plugin.
  9. DONE! Move onto next language…

Before You Translate

  1. Make sure you use translatable strings in your plugin. For example, use __(“My plugin is cool”), rather than just plain “My plugin is cool”.
  2. 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.
3 comments
barrelalexander
barrelalexander

I have been using another translation tool and I really recommend it, as an alternative to Poedit that doesn't need to be downloaded and it has very useful features: https://poeditor.com/

vslavik
vslavik

Poedit author here. Thanks for the nice article!

Just to clarify your last point, setting the "Text Domain" and "Domain Path" headers is definitely the best way to do it, because Poedit trusts them. But even if they are missing, Poedit tries to get this information from the PHP code itself, which should work in most cases. And I keep improving the detection logic as I learn about problematic themes/plugins, so it will only get better.


themergency
themergency moderator

@vslavik thanks for the comment, and thanks for the great tool too :)