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:
- Download POEdit
- Run POEdit, then go to File > New…
- Select the language of your translation strings in the plugin
- Go to File > Save and save the file somewhere (recommended to put it in the languages folder inside your plugin)
- Click “Extract From Sources”
- Click the small “+” button under “Paths” (bottom left corner) and select the main folder of your plugin
- Click the “Sources Keywords” tab along the top
- Click the small add button (second from the left)
- Enter __ (that’s two underscores) then press enter
- Click on the small add button again, then enter _e (underscore then e) and press enter
- 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)
- Click OK
- 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
- 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.