# Translating Static Strings

Technically, translating static strings in WordPress is replacing one word with another, regardless of the language. If you want to change the default words, you need to create a language file for for the language you want to translate the plugin into and follow the instructions in this manual.

{% hint style="info" %}
The manual below is for translating the Plugin into another language. If you need to create a multilingual site and translate the plugin into different languages at the same time please skip this section and follow the WPML integration manual below.
{% endhint %}

{% content-ref url="translating-calculator-with-wpml" %}
[translating-calculator-with-wpml](https://docs.stylemixthemes.com/cost-calculator-builder/translating-cost-calculator-into-a-different-language/translating-calculator-with-wpml)
{% endcontent-ref %}

## Translation Preparation

Before you start translating the plugin, you need to make sure that the language of WordPress matches the language you want to translate. To change the language go to **Dashboard > Settings > General** and choose your language in **Site Language**.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FaVCBcQL09U1kUClv19VA%2FCCBN%20-%20%20Loco%20dashboard%20settings.png?alt=media&#x26;token=da906016-6d85-4ba4-8a96-56cca343c0b4" alt=""><figcaption></figcaption></figure>

There are several ways to fill up translations. One of them is using the [PoEdit](https://poedit.net/) platform. You can add translation via editing your **.po** file and at the end, **PoEdit** generates a **.mo** file for you. Then you need to upload ready translation files to primordial folder (plugins\cost-calculator-builder-pro\languages).

The easiest way of translating the theme is by using the [Loco Translate](https://wordpress.org/plugins/loco-translate/) plugin. Loco Translate is a free plugin and can be installed from the default repository of WordPress.

## Loco Translate Installation

To install the plugin, go to Dashboard and find the **Plugins** section from the left menu and choose **Add New.**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FdFTjklEdlzJFpT262CGW%2FCCBN%20-%20%20Loco%20add%20new%20plugin.png?alt=media&#x26;token=d71ebccd-d9ad-41c3-a9d1-978a48658667" alt=""><figcaption></figcaption></figure>

You need to search **Loco Translate**, install it, and activate it on the opened page.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2F0aFcDNEGSya2kq8DIcq1%2FCCBN%20-%20%20Loco%20find%20loco.png?alt=media&#x26;token=346835b9-d4ad-4a8a-9a05-8d5457ce02c7" alt=""><figcaption></figcaption></figure>

## Creating Translation Files

Static strings are available in the **Cost Calculator Builder** and **Cost Calculator Builder**  **Pro** plugins. Therefore, in this manual, we will consider how to translate strings and keep translations up to date in these plugins.

{% tabs %}
{% tab title="Cost Calculator Builder" %}
Go to **Dashboard** > **Loco Translate > Plugins** and choose **Cost Calculator Builder**.&#x20;

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FwcFHIZ7XbTQ1CzrpFPtp%2FCCBN%20-%20%20Loco%20free%20plugin%20edit.png?alt=media&#x26;token=baf91c49-8ff6-470f-9328-3d750072f49c" alt=""><figcaption></figcaption></figure>

Here you can create your own language to translate the not editable content of the plugin. Create a language by clicking **New language**.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2Fc8hHk8iM0kd5xCZpd4H7%2FCCBN%20-%20%20Loco%20free%20plugin%20new%20language.png?alt=media&#x26;token=617a9e51-e5c9-47de-828b-ced9c3bcb66c" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important!**&#x20;

It is required to store the translation file in the **“.../wp-content/languages/plugins/”** folder to keep translation during the updates.
{% endhint %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2F6JrjdjYP1iHAg5hwiNeB%2FCCBN%20-%20%20Loco%20free%20plugin%20new%20language%20created.png?alt=media&#x26;token=28116f3e-154c-4b23-865a-2e379627ad98" alt=""><figcaption></figcaption></figure>

After clicking the **Start Translation** button, you will be directed to the Loco Translate editor where you can start translating the plugin strings. Click on **Sync** button to update available strings available for translating.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FFb6SWaoaJRc99xxxptSN%2FCCBN%20-%20%20Loco%20free%20plugin%20new%20language%20sync.png?alt=media&#x26;token=fb29ad2c-a884-4533-a85d-466030afb300" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Cost Calculator Builder Pro" %}
Go to **Dashboard** > **Loco Translate > Plugins** and choose **Cost Calculator Builder Pro**.&#x20;

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2F8WAkdJW4t2jq32vJtatL%2FCCBN%20-%20%20Loco%20pro%20plugin%20edit.png?alt=media&#x26;token=3005b173-8672-4ac7-85f9-6bcbfb4e1912" alt=""><figcaption></figcaption></figure>

Here you can create your own language to translate the not editable content of the plugin. Create a language by clicking **New language**.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FPdZLkEUdXh6X7gAkqQlW%2FCCBN%20-%20%20Loco%20pro%20plugin%20new%20language.png?alt=media&#x26;token=5fbbb05a-0dd5-45ee-8e3d-2435bec78771" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
**Important!**&#x20;

It is required to store the translation file in the **“.../wp-content/languages/plugins/”** folder to keep translation during the updates.
{% endhint %}

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2F7rsrZUIrgSZ0SmvB7BzD%2FCCBN%20-%20%20Loco%20pro%20plugin%20new%20language%20created.png?alt=media&#x26;token=a8b557de-ffa5-411d-bc37-be9fd2e97112" alt=""><figcaption></figcaption></figure>

After clicking the **Start Translation** button, you will be directed to the Loco Translate editor where you can start translating the plugin strings. Click on **Sync** button to update available strings available for translating.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FijVUospyFCZKbn3964RD%2FCCBN%20-%20%20Loco%20pro%20plugin%20new%20language%20sync.png?alt=media&#x26;token=dbc62b01-4770-4c9c-9e83-384fb9741aa9" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Plugins Translation

After synchronizing the strings, you need to select an English text from the Source text box and type in the translations for the selected language below.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FWjnS6v2ga6GAi5lwFYwX%2FCCBN%20-%20%20Loco%20%20plugin%20new%20language%20translate.png?alt=media&#x26;token=58d0c278-87fc-4a8c-960f-2786b0fcc0b4" alt=""><figcaption></figcaption></figure>

The changes above translate the Quantity field label into Spanish:

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FPMpkdu8b8rNbX97epngd%2FCCBN%20-%20%20Loco%20%20plugin%20quantity%20translated.png?alt=media&#x26;token=692ee393-a448-47df-b03f-1fc7c2897f6d" alt=""><figcaption></figcaption></figure>

Continue this step for each of the English text strings in the "**Source Text**" box.&#x20;

{% hint style="info" %}
***Please note***: Not all of the English text strings really need to be translated, nor should they be translated. For example, some are bits of text your site visitors will never see as it's on your WP Dashboard area. Or, it may be strange-looking bits of code that look like this: **%1$s at %2$s.** You can ignore these strings.
{% endhint %}

When finished, click the blue **“Save”** button.

## Translations Update

We are improving the **Cost Calculator Builder and Cost Calculator Builder PRO** plugins in every update with new features and options. Some of them display on the front end of the website. Therefore, it needs to update the language and translation files to translate the new strings in the theme.

{% hint style="info" %}
The following steps should be done with **Cost Calculator Builder PRO** to keep translations updated after plugin updates.
{% endhint %}

The first thing to do is to update the main language file, where all the theme strings are stored. Go to the **Dashboard > Loco Translate > Plugins > Cost Calculator Builder** and choose **Edit template.**

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FhUEFMUIuARL0DZDqaogX%2FCCBN%20-%20%20Loco%20%20plugin%20update%20translation.png?alt=media&#x26;token=6594e365-dc05-4668-987b-9f920a6f23cf" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
This is NOT a translation file. Manual editing of source strings is not recommended.
{% endhint %}

Click on the **Sync** button to merge new strings from the source code to the main language file and click on **Save** button to save the new strings.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FlNKpqALNzJ9QZ3iRPOAs%2FCCBN%20-%20%20Loco%20%20plugin%20update%20template.png?alt=media&#x26;token=8397943e-a597-43b7-b9ce-eaddc8edc6f4" alt=""><figcaption></figcaption></figure>

Go to the list of the translation files for updating the needed translations.&#x20;

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FMG6cFHTUpWhLwxdoI5WV%2FCCBN%20-%20%20Loco%20%20plugin%20update%20template%20free.png?alt=media&#x26;token=818e6d34-506a-42f8-962c-1d1a1a0095b3" alt=""><figcaption></figcaption></figure>

Select your translation file and click on the **Sync** button and **Save** changes.

<figure><img src="https://834137925-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MDTO7zmTA5-HpvK8JDA%2Fuploads%2FijVUospyFCZKbn3964RD%2FCCBN%20-%20%20Loco%20pro%20plugin%20new%20language%20sync.png?alt=media&#x26;token=dbc62b01-4770-4c9c-9e83-384fb9741aa9" alt=""><figcaption></figcaption></figure>

{% hint style="success" %}
Please contact our [support team](https://support.stylemixthemes.com/tickets/new/support?item_id=29) if for some reason the translations do not work even though you have done all according to the manual.
{% endhint %}
