How to Translate the Plugin

How to Translate WordPress Plugins

Aside from running your plugins in English, the plugins can be also used in different language. All you need to have is the translated version of the plugin's interface in .po and .mo files.
In this guide, we'll show you how to make your own .po and .mo files to translate the plugin to your preferred language.


Creating your Language Translation files

Each plugin should provide a .pot file located in a Language folder (or as specified). You will need this file to import the strings to be translated. You can open the .pot file using a localization management tools such as POEditor. Here is a step-by-step guide on how to do so:

1. Add a New Project to start your new translation

2. Upon adding a new project, click on Import Terms to add your .pot file

3. Go to Add Language and specify the Language that you want to add

4. Proceed on adding your translations

5. When done, Export the translations to .po and .mo files

Note:

  • Save the translation file with the same name as your .pot file. Add the correct WP Locale beside the file name. In example, if your .pot file is named thisplugin.pot then if you translated them to English (UK), the files should be saved as thisplugin-en_GB.po and thisplugin-en_GB.mo
  • You can look for the WP Locale suffixes here.

Installing Translation files to your WordPress site

The .po and .mo files needed for the plugin translation should be installed in your /wp-content/languages/plugins for them to work. This can be done via FTP.