Your cart

Your cart is empty

Translate & Adapt More Than 2 Languages

💪 Difficulty: Intermediate
 Time to Implement: 20 minutes
🤷‍♀️ Why: Translate more than 2 languages in bulk if you hit the 2-language auto-translate limit
🔗 Important Links: You'll need Google Docs and the Script here.
Within the Shopify Translate and Adapt app which allows you to translate your store and connect languages to Markets i.e. show French for visitors from France and English to visitors from the UK - there is a pesky limit - you can only auto-translate a maximum of two languages. That being said, you would still be able to manually translate content if you hit your limit. Here is how to manually translate your content in bulk using the Google Translate API inside Google Sheets

1. Choose the language you want to translate and click on Auto-translate

Choose the language you want to translate and click on Auto-translate

2. If you see the below message, you have reached your limit and will need to manually translate - continue following the steps below.

If you do NOT see the below message you may not have reached the limit and you can proceed with the auto-translation (yay)

If you see the below message, you have reached your limit and will need to manually translate - continue following the steps below.

3. Click on Manage to open the 'Languages' settings

Click on Manage to open the 'Languages' settings

4. Click on Export

Click on Export

5. Select the Language you want to export and translate

Select the Language you want to export and translate

6. Click on Export

Click on Export

7. Upload the CSV you exported to a Google Drive

Upload the CSV you exported to a Google Drive

8. Click on Open with

Click on Open with

9. and select Google Sheets

and select Google Sheets

10. Instead Google Sheets click on Extensions from the menu

Instead Google Sheets click on Extensions from the menu

11. Click on Apps Script

Click on Apps Script

‼️ Copy and paste the Script below

function translation(text, froml, tol) {

 

  // Check if source and target languages are the same

 

  if (froml === tol) {

 

    return ''; // Return blank if source and target languages are the same

 

  }

 

  

 

  // Check if source text is only a number

 

  if (!isNaN(text)){

 

    return ''; // Return blank if source text is only a number

 

  }

 

 

 

  // Convert text to string if it's not already

 

  var inputText = String(text);

 

  

 

  // Extract the Liquid code by matching text inside double curly brackets

 

  var liquidCode = inputText.match(/{{\s*[\w\.]+\s*}}/g);

 

  

 

  // Replace the Liquid code with a placeholder for translation

 

  var cleanedText = inputText.replace(/{{\s*[\w\.]+\s*}}/g, '[[liquid_code_placeholder]]');

 

  

 

  // Translate the cleanedText

 

  var translatedText = LanguageApp.translate(cleanedText, froml, tol, {contentType: 'html'});

 

  

 

  // Restore the Liquid code in the translated text

 

  if (liquidCode) {

 

    liquidCode.forEach(function(code, index) {

 

      translatedText = translatedText.replace('[[liquid_code_placeholder]]', code);

 

    });

 

  }

 

  

 

  return translatedText;

 

}

12. Delete the default code

Delete the default code

13. Paste the code you copied above text into the text area

Paste the code you copied above text into the text area

14. Click on Deploy…

Click on Deploy…

15. Click on New deployment

Click on New deployment

16. Click on Enable deployment types

Click on Enable deployment types

17. Click on Web app

Click on Web app

18. Type "translation"

Type "translation"

19. Click on Who has access…

Click on Who has access…

20. Click on Anyone

Click on Anyone

21. Click on Done

Click on Done

22. Select the first cell in the column for 'Translated Content'

Select the first cell in the column for 'Translated Content'

23. Type the formula '=translation

Type the formula '=translation

24. Select the cell with the content you want to translate then add a comma (,)

Select the cell with the content you want to translate then add a comma (,)

25. Type the language code for the language you are translating from.

In this case it is English so we have used "en", end with a comma (,)

Type the language code for the language you are translating from.

26. Next select the cell that contains the language you are translating to

In this example it is Polish (pl) in cell D2

Next select the cell that contains the language you are translating to

27. Click enter to run the formula and translate

If you see the translation in cell H2 - great! If you don't see the translation, you see 'Error' please check your formula.

Click enter to run the formula and translate

28. You can now click and drag the formula down to complete the translation for all rows and content

You can now click and drag the formula down to complete the translation for all rows and conrtent

29. Note: If you see an error message like the below, you have reached the API limit for the day. You will need to translate your content in batches so come back tomorrow to complete the process.

Note: If you see an error message like the below, you have reached the API limit for the day. You will need to translate your content in batches so come back tomorrow to complete the process.

30. After all of your content and been translated, click on File

After all of your content and been translated, click on File

31. Click on Download…

Click on Download…

32. Click on Comma Separated Values (.csv)

Click on Comma Separated Values (.csv)

34. Go back to Shopify > Settings > Languages > Click on Import

Go back to Shopify > Settings > Languages > Click on Import

35. Select the CSV you just downloaded

Select the CSV you just downloaded

36. Click on Upload and continue

Click on Upload and continue

37. To assign the language to a Market/Country

To assign the language to a Market/Country

38. Click on Assign to markets

Click on Assign to markets

39. Turn the Toggle on next to the country you want to assign the language to and click on Done

Turn the Toggle on next to the country you want to assign the language to and click on Done
Previous post

Leave a comment

Please note, comments must be approved before they are published

Shopify How-Tos

Translate & Adapt More Than 2 Languages

💪 Difficulty: Intermediate⏰ Time to Implement: 20 minutes🤷‍♀️ Why: Translate more than 2 languages in bulk if you hit the 2-language auto-translate limit🔗 Important Links: You'll need Google Docs and the Script here. Within the Shopify Translate and Adapt...

Read more

Understanding E-commerce Metrics: A Guide to Setting Goals and Improving Sales

In this guide, we will explore the importance of e-commerce metrics and how to use them to set goals and improve sales. You can download the Google sheet template that our...

Read more

Add a free gift with purchase (automatically)

If you've ever tried to run a free gift with purchase campaign, you know it can be a little bit frustrating. You can set up an automatic discount in Shopify...

Read more