Multi-language setup

How you can setup your templates to automatically display the correct language document when using one of these apps.

Blanca Gongora avatar
Written by Blanca Gongora
Updated over a week ago

It is possible to have your templates in multiple languages at the same time and for the app to show the correct language document for each customer automatically. It does take some setting up, but once done will automate the process completely.

Note: The following guide is relevant if you are using the default template designs that are provided within the Order Printer Pro app.

Each template contains a section where all of the wording for the template is setup. To make a template support multi-language, you repeat that section for each language and have some additional liquid code to switch to the correct language section based on the customers' language.

Step 1

Go to the "Manage templates" page of Order Printer Pro

Step 2

Click the "Edit template" button on the template you would like to set up in multiple languages

Step 3

In the "Code" section, you will see the section that controls the wording of your template:

Step 4

Open a text editor or Word document, and paste the following into it:

{% assign language_code = attributes.lang | default: customer_locale | split: "-" | first %}
{% case language_code %}
{% when 'de' %}
GERMAN WORD ASSIGNMENTS
{% else %}
DEFAULT LANGUAGE ASSIGNMENTS
{% endcase %}

IMPORTANT: The above language identifier of 'de' is only an example of the German language. Make sure you enter the two-character language identifier for your translation app account.

Here is another example if you want to translate into more than two languages:

{% assign language_code = attributes.lang | default: customer_locale | split: "-" | first %}
{% case language_code %}
{% when 'en' %}
English WORD ASSIGNMENTS
{% when 'es' %}
SPANISH WORD ASSIGNMENTS
{% when 'de' %}
GERMAN WORD ASSIGNMENTS
{% else %}
DEFAULT LANGUAGE ASSIGNMENTS
{% endcase %}

Step 5

Copy the section of code from your template that defines the wording in the document:

Step 6

Paste that into each of the sections where you added a language, and translate the words into the correct language. For example:

{% assign language_code = attributes.lang | default: customer_locale | split: "-" | first %}
{% case language_code %}
{% when 'de' %}
PASTE HERE THEN TRANSLATE TO GERMAN
{% else %}
PASTE HERE
{% endcase %}

Note: Only change the wording that is within the quotes. For example:

{% assign TEXT_receipt_tax_invoice = "Receipt / Tax Invoice" %}

Would be translated like this:

{% assign TEXT_receipt_tax_invoice = "Rechnung" %}

Step 7

Copy all of the text in your text editor or Word document, and paste it back into the template, replacing the old wording section. In the end, it should look similar to this:

Step 8

Click the "Save" button at the top of the page.

You are done. Now this template will automatically switch to the correct language for each order/customer based on the language that they used at checkout.


💡Tip

If you want to set the template language based on the currency and not the language used, you may use this code instead:

{% case currency %}
{% when 'EUR' %}
TEMPLATE CODE FOR ORDERS IN EUR
{% when 'GBP' %}
TEMPLATE CODE FOR ORDERS IN GBP
{% else %}
TEMPLATE USED FOR ORDERS IN OTHER CURRENCIES
{% endcase %}

Have more questions? No worries, get in contact with our support team using the message icon on the lower right corner of this page.

Did this answer your question?