WPLoyalty Knowledgebase
Back to WPLoyaltySupportMy Account
  • WPLoyalty Knowledgebase
  • Installation & Updates
    • Installation
    • Updates
    • License Key Validation
  • Quick Start Guides
    • Creating a Loyalty Points program
    • Creating a Referral Program
    • Creating a Customer Reward Page
  • Campaigns
    • Creating a Campaign
    • Campaign Types
    • Campaign Rules
    • Creating a Reward
  • Campaign Types
    • Points for Purchase
    • Reward for spending
    • Review Reward
    • Referral Campaign
    • Social Share Campaigns
    • Birthday Reward
    • Sign Up Reward
    • Social Pages Follow Campaign
    • Achievement Campaign
      • Custom Action
  • Reward Types
    • Points Conversion
    • Fixed Discount
    • Percentage Discount
    • Free Product
    • Free Shipping
  • Add-ons
    • WPLoyalty - Launcher
    • WPLoyalty - Points Expiry
    • WPLoyalty - Multi Currency
    • WPLoyalty - Discount Rule Integration
    • WPLoyalty - Judge.Me
    • WPLoyalty- Migration
      • Migration from WPSwings Points and Rewards
      • Migration from WooCommerce Loyalty Points & Rewards
      • Migration from WooCommerce Points and Rewards
    • WPLoyalty - Guest Referral
  • WPLoyalty - Brand Condition
    • WooCommerce Brands
    • Perfect Brands for WooCommerce
    • Page
  • WPLoyalty - Level Action
  • Customers, Levels & VIP
    • Creating Levels / Badges
    • Creating Tiered Levels / VIP Customer Rewards
    • Importing Customers and points
  • Translating WPLoyalty
    • Using LocoTranslate
    • Translating Dynamic Strings with LocoTranslate
    • Using WPML
    • Translate dynamic strings via WPML
    • Using TranslatePress
  • Guides
    • How does WPLoyalty work on websites with multiple languages ?
    • How to create user role specific campaigns in WPLoyalty ?
    • Purchase History conditions with examples
  • Settings
    • Display Settings
    • Customizing Emails for Points & Rewards Earned / Expiry
  • Developers
    • REST API with WPLoyalty PRO Plugin
Powered by GitBook
On this page

Was this helpful?

  1. Translating WPLoyalty

Translating Dynamic Strings with LocoTranslate

Guide to Adding and Translating WPLoyalty Dynamic Strings with Loco Translate

PreviousUsing LocoTranslateNextUsing WPML

Last updated 1 month ago

Was this helpful?

In this guide, we will walk through the following steps in detail:

Step 1: Understanding Dynamic Strings

We'll define dynamic strings as strings that are added dynamically by users, such as campaign titles/descriptions and strings from the Launcher widget etc..,

Step 2: Why the WPLoyalty - Multi-Lingual Compatibility - Dynamic Strings Addon Plugin was Developed

Initially, dynamic strings were missing from the translation table of LocoTranslate. To address this issue, we created an add-on plugin called Multi-Lingual Compatibility - Dynamic Strings. With this plugin, adding dynamic strings to the translation table of LocoTranslate is easy, and translation can be done in just a few clicks, streamlining the process.

Step 3: Installing the WPLoyalty - Multi-Lingual Compatibility - Dynamic Strings Addon Plugin:

To install the add-on, follow these steps:

  1. Go to your WordPress dashboard -> Plugins -> Add New

  1. Click on the "Upload Plugin" button on the top.

  1. Use the Browse option and add the downloaded wp-loyalty-translate addon plugin zip file.

  1. Click Install now and Activate plugin.

  2. After activation, you can access the add-on by navigating to WPLoyalty -> Add-ons -> "WPLoyalty - Multi-Lingual Compatibility - Dynamic Strings” add-on plugin.

  1. If you click on the “Open” option this will be the dashboard of Multi-Lingual Compatibility - Dynamic Strings Add-on plugin.

Step 4: Installing and Setting Up LocoTranslate:

Step 5: Adding Dynamic Strings to the wp-loyalty-rules.pot File:

After installing LocoTranslate, follow these steps:

  1. Go to LocoTranslate -> Plugins -> select the "WPLoyalty - Woocommerce Points, Rewards and Referral plugin".

  2. Look for the "Edit Template" option and click on it.

  1. You will be directed to the "wp-loyalty-rules.pot" file. Click on the "Sync" option to automatically add the dynamic strings to the translation table. Remember to save the changes.

Step 6: Synchronizing strings from wp-loyalty-rules.pot file to wp-loyalty-rules-fr_FR.po file:

  1. Go to Loco Translate -> Plugins and select "WPLoyalty - Woocommerce Points, Rewards and Referral plugin."

  2. Look for the "Edit" option.

(Note: As we have already translated the strings for French by following the above steps, the file "wp-loyalty-rules-fr_FR.po" is displayed). Click on "Edit."

  1. Next, you will be directed to the French .po file. Click on the "Sync" button located here as well.

After syncing the dynamic strings to the translation table, you can easily search for the strings and begin translating them.

Step 7: Translating the dynamic strings:

Example 1: Translating Campaign title "Earn 1 Point for every $10 Spent"

  1. Navigate to Loco translate -> Plugins -> choose the "WPLoyalty - Woocommerce Points, Rewards and Referral plugin."

  2. Click on the "Edit" option.

  3. Search for the dynamic string "Earn 1 Point for every $10 Spent" in the search bar.

  4. Click on the translation box next to the string and enter the translated string.

  5. Click on the "Save" button to save the translated string.

Now, we have successfully translated the campaign title to French.

Example 2: Translating string from Launcher: "Hello {wlr_user_name}"

Search for the string "Hello {wlr_user_name}" in the search bar, enter the transtlated string in French and save it.

Here is the screenshot of Launcher in French:

Now, we have successfully translated one of the Launcher string to French.

In the same way, we could search for any variable strings and translate them.

Note:

Video:

For translating Campaign title:

This "" addon is exclusively available for WPLoyalty users. This add-on is provided at no cost to users of WPLoyalty plugin.

Still unclear ? Please submit a . We are always happy to assist you :)

To learn about how to install and set up LocoTranslate, please click here.
For a detailed step-by-step procedure on creating a Campaign, please refer to the documentation.
Multi-Lingual Compatibility - Dynamic Strings
support request
Click here to download the Multi-Lingual Compatibility - Dynamic Strings add-on.