> For the complete documentation index, see [llms.txt](https://docs.wployalty.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wployalty.net/translating-wployalty/translating-dynamic-strings-with-locotranslate.md).

# Translating Dynamic Strings with LocoTranslate

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

**Step 1:** **Understanding Dynamic Strings**&#x20;

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..,&#x20;

**Step 2: Why the WPLoyalty - Multi-Lingual Compatibility - Dynamic Strings Addon Plugin was Developed**&#x20;

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:**

[**Click here to download the Multi-Lingual Compatibility - Dynamic Strings add-on.** ](https://wployalty.net/add-ons/multi-lingual-compatibility/)

To install the add-on, follow these steps:

1. Go to your WordPress dashboard -> Plugins -> Add New&#x20;

<figure><img src="/files/IX4znfiaIk3vrLTQd1lc" alt=""><figcaption></figcaption></figure>

2. Click on the "Upload Plugin" button on the top.&#x20;

<figure><img src="/files/RPR0Gp1yaHNY0KiZ5Qmx" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/63OGGg5uktjRFMGqO2ly" alt=""><figcaption></figcaption></figure>

4. Click Install now and Activate plugin.
5. After activation, you can access the add-on by navigating to WPLoyalty -> Add-ons -> "WPLoyalty - Multi-Lingual Compatibility - Dynamic Strings” add-on plugin.

<figure><img src="/files/gZbjpOi1JnL2L5rQxVXd" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/rUW75Fjdtooo5aaujZYw" alt=""><figcaption></figcaption></figure>

**Step 4: Installing and Setting Up LocoTranslate:**&#x20;

[To learn about how to install and set up LocoTranslate, please click here. ](https://docs.wployalty.net/translating-wployalty/using-locotranslate)

**Step 5: Adding Dynamic Strings to the wp-loyalty-rules.pot File:**&#x20;

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.

<figure><img src="https://lh4.googleusercontent.com/xYe2vw_HGp6YC42L422cqgBRXH3-K3xZ_7yAN_qA1a3KniLbPRl0gVR5nbAny1iFbK6-HIiuxLf_CxjswEgaI2j7Z25ycxtrvvvPxB_sQ1CCnkQ7twf7jM3UW1Q40GLunvM59dYNueXMDKl96BeH6n42zCjhamhENvkL2XXDGdmSoDeVjdH7C01ZHYKWvQ" alt=""><figcaption></figcaption></figure>

3. 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.

<figure><img src="https://lh6.googleusercontent.com/32JBKXP8g9JgqaKQWFm1jeAQ1_juEmIFLGNR9hAVPLJUFSRL8ccMrJ7cX3ZQTidwZu9Difzam_znmvmdP8LB6Kv3HtKmWyZFyAtjF_SN05meaFjWyRiJVYJ35K-mZdam5vUNz4ITOEhKTTacMSKckrEd9qEwB0cDzRbkVIcmXogyx5-RRvQz5QoNAVTbDg" alt=""><figcaption></figcaption></figure>

**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.&#x20;

(**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."

<figure><img src="/files/SpqtvoCmLuY2if18wFdi" alt=""><figcaption></figcaption></figure>

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

<figure><img src="/files/dfZ8532FbXU1yBpSk3vm" alt=""><figcaption></figcaption></figure>

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:**&#x20;

**Example 1: Translating Campaign title "Earn 1 Point for every $10 Spent"**&#x20;

[For a detailed step-by-step procedure on creating a Campaign, please refer to the documentation.](https://docs.wployalty.net/campaign-types/points-for-purchase)

<figure><img src="https://lh3.googleusercontent.com/9JfQaFdxgc7uKyvdfzyLjOWfDC8BXSzl96JiONPT2Y1yaakl7FE7HPHn8s_mAf9UrHDI1YIn399zcq52r7QwyxStyCZ4lqgaEy3NZKnuvhBxBENoPuHUKK0MSXexo2muHmPZY1tsIFscwFzuxb5nfTgeX9opU_aCr_3eU_oIVMonJpypB6XR9_appIUbjw" alt=""><figcaption></figcaption></figure>

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.

<figure><img src="/files/NtekvbMbkscU7TyH2qLX" alt=""><figcaption></figcaption></figure>

Now, we have successfully translated the campaign title to French.&#x20;

**Example 2: Translating string from Launcher: "Hello {wlr\_user\_name}"** &#x20;

<figure><img src="/files/WcliA4AhWM8gJvVwrrFH" alt=""><figcaption></figcaption></figure>

Search for the string "**Hello {wlr\_user\_name}**" in the search bar, enter the transtlated string in French and save it.&#x20;

<figure><img src="/files/ea9vrYjCET9isHsqKm5G" alt=""><figcaption></figcaption></figure>

**Here is the screenshot of Launcher in French:**

<figure><img src="/files/SAMj4WQ2XlXBqcgR6NK0" alt=""><figcaption></figcaption></figure>

Now, we have successfully translated one of the Launcher string to French.&#x20;

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

**Note:**&#x20;

* This "[**Multi-Lingual Compatibility - Dynamic Strings**](https://wployalty.net/add-ons/multi-lingual-compatibility/)" addon is exclusively available for WPLoyalty users. This add-on is provided at no cost to users of WPLoyalty plugin. &#x20;

**Video:**&#x20;

**For translating Campaign title:**&#x20;

{% embed url="<https://youtu.be/IuqpAmBVKnU>" %}

Still unclear ?\
Please submit a [support request](https://wployalty.net/support/). We are always happy to assist you :)
