WPML Localization
WPML simplifies the building of multilingual sites and their functioning. It’s powerful enough for corporate sites, yet simple for blogs. With WPML, you can translate pages, posts, custom types, taxonomy, menus and even the theme’s texts.
This plugin works with the WPML plugin.
Getting started
First of all, you need to purchase the most recent version of the WPML plugin and include the String Translation and Translation Management modules that you can find inside the package you get after the purchase. These two elements are essential for the correct use of the plugin.
WPML is composed of different modules, depending on the purchased version, and every one offers various options about the translation of your site. Once activated, a tab will appear on the dashboard of your installation and from there you will be able to change all the settings you want.
WPML Language Configuration
Choose the languages you want to set for your site and set the content management in the different languages.
If this is the first time that you configure WPML, select the language of the current content. Later, you can add a language selector in your theme to allow users to change it: you can customize its style and the number of languages to show, as you can see.
Theme and plugin localization
WPML lets you localize plugin with the classic .mo file, or translating the text directly from WPML.
In the first case, it will suggest the translation of many strings, so you will just have to choose the second option from the localization menu and set the domain of the text of the plugin. On the contrary, if you choose the first option as in the image above, you will start the WPML localization plugin scanning all strings, and getting the texts that can be translated. You can add the translation of the relative text from WordPress itself: for further information go to this page.
String translation
With WPML you can translate the YITH Desktop Notifications for WooCommerce strings in the desired language.
When we talk about strings, we are referring to all those labels and related contents, from option and widget names to all the texts showed to users with the plugin features.
As a first step go to WPML -> Theme and plugins localization, select the plugin and click on “Scan the selected plugins for strings” (we used YITH Plugin as an example)
Click on String Translation, the entry you can find in the WPML sub-menu.
In the top part of the page, WPML lets you select the “context” in which search for the strings, and to specify the string you want to translate.
To translate the string that you search, select the plugin YITH Desktop Notifications for WooCommerce domain. Our sample plugin text-domain is “yith-sample-plugin”.
Add the string in the related search field.
Please note: if the string you are looking for is related to the value associated to an option of the plugin, you need to select a different text domain since these strings are connected to the database and not to the plugin .po file.
For each string related to an option of the plugin there is a specific associated text-domain that you need to select from the list. This kind of text-domain starts with the admin_texts_ and is followed by a plugin identifier and tag.
For example: admin_texts_ywsp_sample_text.
Select the entry you want to translate, add the translated string, tick the Translation is complete option and click the Save button.
Now the status will be Translation Complete and the string will be correctly displayed in the selected language.
Do you need to translate a new string that’s going to be displayed in your frontend? You have to load the page of the browser where the contents of the plugin are showed, so that the strings become dynamic and WPML can “capture” them for the translation.
CONCLUSIONS
WPML offers to users its language selector as a drop-down list of languages: if you are searching for something different, you can always go to this page. for further information.
For more information about the WMPL configuration, please read the official documentation.