How to translate a WordPress plugin into your language?

WordPress plugins are usually developed in English as it’s considered the universal language. In this tutorial, we will explain how you can translate a WordPress plugin into a different language.

Luckily, WordPress contains features to make plugins translateable. If developers use these features correctly, their plugin can be translated into any language.

Let’s dive in and learn how to translate a WordPress plugin!

Step 1: install POEdit

Before you can begin translating a WordPress plugin into your own language, you should download and install the free version of POEdit. POEdit is a tiny piece of software that makes translating plugins a lot easier. We’ll use it throughout this tutorial.

Additionally, there is a premium edition that offers translation suggestions and semi-automatic localization. Since our only requirement is to help with manual translations, the free version of Poedit will suffice.

Step 2: find the plugin’s .pot file

Each WordPress plugin should include a .pot file. This file contains a list of all plugin texts in English and will be your reference during translation. Note that this file contains text used on both the frontend and backend (the WP admin) of your site.

To find the .pot file, extract the ZIP archive of the plugin to your file system and search for the file. It’s usually located inside a languages or lang or i18n folder. For example, for our Advanced Product Fields plugin, you can find the file in the main plugin folder → languages → sw-wapf.pot:

Locating a plugin's .pot file

Step 3: start a new project in POEdit

Open POEdit and click Create New. Then browse to the .pot file you found in the previous step of this tutorial.

The start screen in POEdit

Next, select the language you’d like to translate the plugin to:

Select translation language in POEdit

Step 4: translate

Now it’s time to translate the WordPress plugin using POEdit.

The main translation screen in POEdit

The top part of the main translation screen in POEdit shows a list of source texts and their translation (if any) next to it. Select any text you’d like to translate by clicking on the corresponding row.

At the bottom, in the Translation section, you can add your translation for the source text. Repeat this process for all texts you’d like to translate. You’re not obligated to translate everything, so you can pick and choose which content to translate. For example, you can translate only text that appears on the website, but leave the content for the WP admin in English.

Step 5: save your work

When you’re done translating, go to File → Compile to MO and save the resulting .mo file somewhere on your hard drive. The saved file should have a specific file name: {filename of pot}-{locale}.mo. The locale is the language code and/or country code. For example, the locale for Dutch is nl_NL, and for German it’s de_DE. Here is a complete list of all locale codes.

In our example, we are translating the file sw-wapf.pot into Dutch, so our saved .mo file should be named sw-wapf-nl_NL.mo.

Step 6: upload translations to your website

In this final step, you have to upload the .mo file from the previous step to your WordPress website. There are two ways of getting files onto your site:

  1. By using the file manager provided in your host’s control panel. Here are some popular file managers: cPanelDirectAdminPlesk.
  2. By using an FTP client. This guide will show you how to use FileZilla.

You should upload the file to this directory: wp-content/languages/plugins.

That’s it! You have now translated a WordPress plugin using POEdit.

Was this article helpful?

Related Articles