ConveyThis automatically translates all the content displayed on your website. However, since emails are not part of your website, ConveyThis does not translate them automatically. Nonetheless, ConveyThis allows you to manually manage email content based on the order language. By utilizing liquid code, you can handle email translation. Please note that while these instructions apply to order notifications, they do not cover Gift Card Creation notifications.
Depending on the languages supported on your website, you will need to modify the code accordingly. You should adjust the language codes in the ‘when’ statements.
For instance, let’s consider a scenario where ConveyThis handles English as the original language and French and Spanish as the target translation languages. The overall Liquid structure would be as follows:
{% case attributes.lang %}
{% when 'fr' %}
EMAIL EN FRANÇAIS ICI
{% when 'es' %}
EMAIL EN ESPAÑOL AQUI
{% else %}
EMAIL IN THE ORIGINAL LANGUAGE HERE
{% endcase %}
The code provided above is just an example. Please ensure that you input the languages managed in your ConveyThis app that you wish to include for email translation.
Here’s another example for translating emails specifically in German:
{% case attributes.lang %}
{% when 'de' %}
EMAIL IN DEUTSCH HIER
{% else %}
EMAIL IN THE ORIGINAL LANGUAGE HERE
{% endcase %}
By implementing the code, if an order is placed in German, the customer will receive the content between the code lines starting with “when ‘de’” and “else”. On the other hand, if the customer places an order in a language other than German, they will receive the content between the code lines “else” and “endcase”. This ensures appropriate language-specific email content for different order scenarios.
{% case attributes.lang %}
{% when 'fr' %}
FRENCH TEXT
{% when 'es' %}
SPANISH TEXT
{% when 'pt' %}
PORTUGUESE TEXT
{% else %}
ENGLISH TEXT
{% endcase %}
For instance, let’s consider the ‘Order Confirmation’ email that needs to be translated.
In this example, since the original language is English, you should replace the placeholder text ‘EMAIL IN THE ORIGINAL LANGUAGE HERE’ with the code you copied.
For instance, when translating to French, modify the sentence ‘Thank you for your purchase!’ to ‘Merci pour votre achat !’ Remember to only modify the sentences and avoid translating any liquid code between {% %} or {{ }}.
In this case, locate the ‘Order Confirmation’ email within your Shopify admin area, and paste the translated content from the text editor into this specific email section.
In this case, the email edited is ‘Order Confirmation’:
You can apply the same process to translate the subject of the email. Copy and paste the code into a text editor, then replace the fields with the translated version of the subject. Here’s an example to illustrate the process:
{% case attributes.lang %}
{% when 'fr' %}
Commande {{name}} confirmée
{% when 'es' %}
Orden {{name}} confirmada
{% when 'pt' %}
Pedido {{name}} confirmado
{% else %}
Order {{name}} confirmed
{% endcase %}
Then, paste the translated subject from the text editor into the ‘Email subject’ field in your Shopify admin area.
To manage customer emails, you can include a language tag in the Customers information within your Shopify admin area. The lang tag will be added based on the language used by the visitor during website sign-up.
To enable this feature, you need to add the line “customer_tag: true” to the ConveyThis code in the “conveythis_switcher.liquid” file. You can access this file by going to your Shopify admin > Online Store > Themes > Actions > Edit Code.
<script src="//cdn.conveythis.com/conveythis.min.js"></script>
<script id="has-script-tags">
ConveyThis.initialize({
api_key: "YOUR_KEY",
customer_tag: true
});
</script>
Once the language tag is added to the code, you can proceed to create customer notifications following the same schema mentioned earlier in this guide. However, for this part, you will need to utilize the following code:
{% assign language = customer.tags | join: '' | split: '#ct' %}
{% case language[1] %}
{% when 'en' %}
English account confirmation
{% else %}
Original Customer account confirmation
{% endcase %}
We value your feedback! If you have any comments or suggestions regarding this article, please feel free to share them with us. Your feedback is important to us and helps us improve our content.
Translation, far more than just knowing languages, is a complex process.
By following our tips and using ConveyThis , your translated pages will resonate with your audience, feeling native to the target language.
While it demands effort, the result is rewarding. If you’re translating a website, ConveyThis can save you hours with automated machine translation.
Try ConveyThis free for 7 days!