English speakers generally have it easy in the WordPress world. Themes and plugins all tend to be English centric which results in a more difficult user experience for those who speak and read in a different language. We’re going to look at a translator plugin called Loco Translate which will help in this regard.
The Loco Translate plugin by author Tim Whitlock is a great choice if you want to translate WordPress theme or plugin right in your Dashboard. It provides you the opportunity to perform the in-browser editing of any included PO file.
PO? MO? What are these?
WordPress uses PO and MO files to manage translations. The reality is that WordPress only needs MO files to manage translations. PO files are human readable translation files, they are those files with a list of strings ready to be translated or with a translation already included. They are those files that Loco Translate uses to show you the strings.
Methods of Translation
There are two commonly used ways to translate a theme or plugin:
- Directly within WordPress by using a localization plugin
- On your PC/Mac, using the desktop software Poedit
Today we will learn how to translate themes and plugins using Loco Translate.
1: Install Loco Translate
To install the plugin go to Plugins > Add New menu and search for Loco Translate to filter out the plugins list and click on the Install button to install the plugin on your WordPress installation.
After the installation is finished you need to click on the Activate Plugin link to activate Loco Translate. You’ll then see a Loco Translate menu item towards the bottom of the WordPress sidebar.
2. Check you can switch language
Loco Translate isn’t responsible for setting your WordPress language, but we’ll cover this step because it’s important.
Go to the Settings > General screen in WordPress and scroll to the bottom. You should see a dropdown list with the label “Site Language”. Changing this will set a new default language for all site visitors. Try it and see.
We’re going to set the language to Italian, listed under “Available > Italiano” in the list. Once WordPress has downloaded the core language packs for Italian this entry will move to the “Installed” section.
3. Next, Create a Translate File
When you are ready, you will have a new menu item named Loco Translate on the left in your Dashboard. Click on Loco Translate > Manage Translations.
Next to a list of all your installed themes you’ll see a “New Language” option with a plus icon beside it. This appears because the theme or plugin includes a language .pot template file. Without it, a translation wouldn’t be possible.
Click on New Language and you’ll be directed to the following screen:
You can choose which language to create your new PO file in. I’ve selected Italian and Loco Translate is smart enough to automatically fill in the language code and place it in the theme’s language directory.
4. Translate the Text
On the next screen, we’ll see a split between all of the strings within a theme, the Source text and an empty panel beneath where you can add your own translation.
Google Translate can help with these, especially with the English originals if it is not your own language.
As an example, if we want to translate the text “Read More” to Italian, We will have to find the “Read More” text from the “Source Text” list and add our translated text in the textarea. In this case “Per Saperne Di Più” inside the “Italian translation” box.
Loco Translate makes a complicated task in WordPress much easier through its easy to use interface, all within the WordPress dashboard you are familiar with.
As an aside, if anyone is using our theme StartRight in a language other than English, we would be very grateful if you would share any translated PO files with us, we’ll add them to the next update and you’ll be credited in the release notes.