Loco Translate is a free and open source WordPress plugin for translating any text from within your WordPress admin.

This guide shows you how to use Loco Translate to easily translate or change the wording of text.

We’re going to focus on text generated by Paid Memberships Pro’s core plugin and our (translation-ready) Add Ons. But you can use the instructions below to help you translate or change any wording on your WordPress site.

Banner for How to Use Loco Translate With Your WordPress Site

Creating a Translation

This guide shows you how to translate the “Choose Your Payment Method” box that is added to the membership checkout page for sites using the Add PayPal Express Option at Checkout Add On.

Choose Your Payment Method box before text is translated
Choose Your Payment Method box before text is translated.

Install Loco Translate

If you do not already have the Loco Translate plugin installed on your site, navigate to Plugins > Add New in the WordPress admin. Search for the term “Loco Translate”, then click “Install Now”, and then “Activate”.

Plugins > Add New page highlighting Loco Translate
Plugins > Add New page highlighting Loco Translate.

Navigate to Loco Translate > Plugins

Once Loco Translate is installed, you can begin a new translation. In order to translate a particular sentence (or in technical jargon a string), it is important to know exactly which plugin is creating that text. If you are not sure, please open a ticket in the members-only support area and we would be happy to help you figure out which plugin needs to be translated.

  1. Navigate to Loco Translate > Plugins.
  2. Select the “Paid Memberships Pro > Add PayPal Express” plugin.
Loco Translate settings page for selecting a plugin to translate.
Loco Translate settings page for selecting a plugin to translate.

Select a Language to Translate Into

After selecting the plugin to translate, Loco Translate displays a list of all existing translations.

  • If you see your desired language on the list, select it.
  • If you do not see your desired language on the list, click the “New language” button to create translations for a different language.

Note that you can also use Loco Translate to change the wording of strings. For example, if you want to change the wording from “Choose Your Payment Method” to “How do you want to pay?”, you should complete these steps as if you were translating into “English (United States).”

Loco Translate settings page for selecting a language to translate into.
Loco Translate settings page for selecting a language to translate into.

Protecting Your Translation Files

If you selected an existing language you may receive a notification that the files may be overwritten or deleted when you update. That’s bad.

To avoid this we recommend you may relocate the language files in the “Relocate” tab by moving them to Loco Translate’s custom localization that is not affected by updates.

Loco Translate language file location settings screen.
Loco Translate language file location settings screen.

Before you start translating, navigate to Editor > Sync to ensure that your language file has the latest text strings. This button updates text strings in your language file by synchronizing them with the master language file (*.pot).

Loco Translate settings to sync strings to your language files.
Loco Translate settings to sync strings to your language files.

If you clicked the “New language” button during the previous step, the next screen prompts you to select a language to create a translation for. If you only want to change the wording of text on your site, not translate text, select “English (United States)”.

Once you have selected the language you would like to translate into, click “Start translating”.

Loco Translate settings page for creating a translation in a new language.
Loco Translate settings page for creating a translation in a new language.

Write Translations

It’s (finally) time to create translations!

  1. Select each string to translate in the “Source text” column.
  2. Enter the translated text (changed wording) in the “[your language] translation:” box.
  3. Once you have updated all of the strings, click “Save” to publish your changes.
Loco Translate settings screen for updating individual translations
Loco Translate settings screen for updating individual translations.

Test That Your Text is Translated

The newly translated text should now show in place of the original text that was present. For this demo, navigate to your Membership Checkout page and confirm that all strings in the “Choose Your Payment Method” box are updated.

Choose Your Payment Method box after text is translated to Spanish
Choose Your Payment Method box after text is translated to Spanish.

Translating Strings Containing %s and %d

%s and %d are variable placeholders for values that will be replaced by plugin code, whether for a text string or numeric string. These placeholders are very important for cases where the displayed text changes based on membership level, price, date, order history, user fields, and more.

For example, the core Paid Memberships Pro plugin uses the following translatable string when a customer checks out for a level that has a trial period:

Your first %d payments will cost %s.

In that string, %d will be replaced with the number of recurring payments that will be charged using the trial price, and %s will be replaced with the formatted price for the amount that will be charged during the trial period.

Do not remove these variables from your translation strings. Instead, translate this string into another language and keep the same placeholders in the translated string as in the original. For example, the Spanish translation of that string would look like this:

Tus primeros %d pagos costarán %s.

David Parker

Author David Parker

David is a Product Manager at Paid Memberships Pro. He manages development for several of our Add Ons and contributes to the development of the core PMPro plugin.