If you have a multilingual website, you probably use the WPML plugin. WooRewards is compatible with WPML and you can translate its content in the languages you need. The following documentation explains how to translate the core content of WooRewards and how to translate the texts you’ve set in the plugin settings.
Getting Started
Make sure that you have activated the WPML Multilingual CMS and WPML String Translation plugins by navigating to Plugins → Installed Plugins.
Translate the plugin’s hard coded sentences
WooRewards already supports several languages as French, Chinese, etc. But you can ask WPML to replace WordPress translations features if :
- You want to support a new language
- You want to override hard-coded sentences
Let WPML analyze the plugin
Go in WPML → Theme and Plugin localization. Look for MyRewards, MyRewards Pro and LWS Admin Panel, check them, then click on Scan selected components for strings. It can take several minutes. At the end, you’ll see a popup with the Scanning results.
Import existing translations
Go to WPML → String translation. In the Utilities window, select the Import/export .po option. In the import group, you need to select the relevant po files and the according domain :
Do not forget to check Also create translations according to the .po file. Else the process continues but nothing will be really imported.
At the end of the process, go down to the bottom of the page and click the Add selected strings button.
Add your own translations
Go to WPML → String translation.
You can take a look at all translatable strings of the plugin using text-domain filter on the following three values: lws-adminpanel, woorewards-lite, woorewards-pro.
Or you can search a specific sentence to replace. Copy the text in the Search for field, (check Include translations if you are not working in english), then click on Search button.
Finally, click the pen icon to edit the translation in the selected language, set your translationand validate by pressing the Enter key
During your translations, take care about placeholders. Some strings could contain words like %s, %1$s… that will be replaced when needed.
Translate your WooRewards input data
Points and Rewards Systems
In WooRewards → Settings, edit one of your systems. After saving your settings (title, points name, etc.), look at the bottom of the page for the WPML translation bloc.
Click on Send to translation. This will open the Translation Management screen.
Note that you can go directly to WPML → Translation Management and filter with WooRewards Loyalty System
value.
On that screen, select all the strings you want to translate, then scroll down to Step 2 – Translate your content.
Select the translation method for your language, then click on Translate. You will then see a popup saying that items have been sent to translation.
Open it and click on Go to translations.
You’ll be redirected to the Translations queue screen. In there, you can translate all sentences one by one, either manually or automatically.
Translate Rewards and Earning Methods
When editing a Points and Rewards System, you can define several Rewards and Earning Points methods. WooRewards provides default generated strings for titles and other fields.
If you don’t override these strings and want to translate them, please see the chapter Add your own translation since they’re hard-coded strings (take care about placeholders, that strings usually contain words like %s, %1$s
… that will be replaced when needed).
If you’ve defined custom titles, descriptions, etc. and saved the Reward or Earning Points method item, you can go to WPML → Translation Management and filter with WooRewards Reward
or WooRewards Points Earning Method
value.
On that screen, check the relevant rows, choose the translation language, go down to step 2 and click on Translate.
Translate Emails, Widgets and Shortcodes
TRANSLATE CUSTOM SENTENCES
In WooRewards → Appearance, when you edit Shortcodes or Emails, some of them allow you to set custom texts. After saving your settings, you can find them back in WPML to provide translations for other languages.
Take care of your site default language and the language you currently display when editing settings, since it affects how WPML guesses the original language of that new custom text. Later, look at the flag near the String in the translation list to be sure.
Go to WPML → String translation.
Copy the text from the shortcode or email and paste it in the Search field, (check Include translations to be safe), then click on Search button.
Finally, click the pen icon and translate the sentence, validate by pressing the Enter button.
ABOUT EMAIL LOCALIZATION
The emails will be translated to the user prefered language (if user is known and he has defined one). WPML is asked to switch on that language by looking on receiver email address.
Information
For the special case of email to sponsored, since user is unknown yet, WooRewards assumes receiver speaks the same language as the sponsor.
Translate WooRewards Badges
First, you have to have at least one WooRewards Badge. They can be found in Badges → All Badges.
After saving your Badge settings, at bottom right of a Badge edition screen, find the WPML box.
Then click on Send to translation button. The translation Dashboard opens with the Badge item in it.
Or you can go directly to WPML → Translation Management. Follow the same procedure as explained above.