How to use POEdit (free version) to create the .po/.mo translation files for your WordPress plugin

The free version of POEdit doesn’t have the “Translate WordPress theme or plugin” functionality, but you can still generate the .po/.mo files used to translate your plugin with these instructions:

  1. Download POEdit
  2. Run POEdit, then go to File > New…
  3. Select the language of your translation strings in the plugin
  4. Go to File > Save and save the file somewhere (recommended to put it in the languages folder inside your plugin)
  5. Click “Extract From Sources”
  6. Click the small “+” button under “Paths” (bottom left corner) and select the main folder of your plugin
  7. Click the “Sources Keywords” tab along the top
  8. Click the small add button (second from the left)
  9. Enter __ (that’s two underscores) then press enter
  10. Click on the small add button again, then enter _e (underscore then e) and press enter
  11. Repeat to add any additional functions you might have used to translate in your plugin, such as esc_html__ (with two underscores at the end)
  12. Click OK
  13. Verify all your strings were found, otherwise go to Catalog > Properties… in the menu and add any additional translation functions (like esc_attr__) in the Sources Keywords tab
  14. Go to File > Save to save your .mo file again

Include the .po and .mo files in your plugin’s languages/ folder or make it available for download somewhere.  You can also use something like GlotPress to provide a system similar to the translate functionality on wordpress.org.

Get a free lesson!

To grab a free lesson and tips on getting over common fears of starting a plugin business, enter your email below.

 


Already in the course? Login here