keyboard_arrow_down

Latest posts

Prestashop Translation Using Google Translate (Tutorial)

This tutorial is prepared on a Prestashop 8.1.7 environment. However, the reasoning behind the steps are the same for all Prestashop versions.

Requirements:

  • Google Chrome
  • Chrome's Google Translate extension should be installed and enabled

In the example below, a module translation will be made.

Step 1:

Open Backoffice > International > Translations > Installed Module Translation > Module Selection > Language Selection > Click 'Modify' button

Step 2:

Click once on the Close all fieldsets button and reclick to expand all fieldsets

Step 3:

The fields are empty. 

Step 4:

Click on the Google Translate button on the right side of the address bar of Google Chrome. Select the source language and the target language. In our case, the page will be translated from English to Turkish.

Step 5: 

The field labels will be displayed in the target language. Now the trick will be implemented.

Step 6: 

Click F12 and open the developer tabs on your Google Chrome. From the tabs, select the 'Console' tab.

Step 7:

Copy the below code lines into the 'Console' tab and hit 'Enter'. When you do this, the label contents will be copeid and pasted into the empty translation fields.

$("td[width='40%']").each(function() {
      $(this).next().next().children().val($(this).text());
    });

 

Special note:

For the new type of translation tabs you can use the below code:


$("div.form-group>label").each(function() { $(this).next().val($(this).text()); });

Step 8:

Click any of the 'Save' or 'Save and Stay' buttons.

Result:

Leave a comment