Adding Localization Using WPML

From this tutorial you’ll learn how to add localization to your WordPress template and plugins using WPML plugin.

Installing WPML
  1. First, let’s install WPML to WordPress. To do it you need to get a WPML account. Here navigate to Downloads and download the WPML components package.
  2. Unzip each of the components. Then add all of the components contained in the separate folders to one archive.
  3. Upload them to wp-content/plugins folder using FTP tool or Upload option in your hosting server cPanel file manager.
  4. Uncompress the package.
  5. Now navigate to WordPress Dashboard > Plugins tab and activate WPML components.
WPML Localization
  1. Let’s locate theme and plugins localization settings. Locate WPML > Theme and plugins localization tab on the left of the Dashboard.
  2. Here you can create translations for texts in themes and plugins. You can use the translations you already have, as well as string translation.
  3. To use the .mo files as the translation backup files check Translate themes and plugins using WPML’s String Translation and always load .mo files as backup.
  4. In the case, you’re translating using String Translation only, check Translate themes and plugins using WPML’s String Translation only (don’t load .mo files).If you select loading the .mo file as a backup, WPML will relay back to .mo file if there are such in your theme and plugins.
    In the case, you see the translation string which is not under the String Translation, then it comes from .mo file in the theme or plugin.
  5. If the text strings are in English, then check Assume that all texts in PHP are in  English.
String Translation
  1. WPML will scan the theme and locate the text to be translated. It will show you all the strings and you’ll be able to enter the translation right from WordPress Dashboard.
    To start manual scanning for texts please, select the theme or a plugin you want to scan and click on Scan selected themes/plugins for strings.
  2. You’ll see how many strings are there for translation.
  3. Navigate to WPML > String Translation tab.
  4. Select the domain (the theme’s or plugin’s name) which texts you need to translate.
  5. Click the translations link on the right of each string and add the translation for the text.
  6. When the translation is complete you’ll be able to switch the languages for the themes and plugins on the website. To learn how to do it, please, feel free to read Adding Language Switcher with WPML Plugin tutorial.
This tutorial is based on Bellaina Real Estate WordPress theme.