Choose the document’s language
In the editor’s top row (or on the template’s settings page), choose the Document language:
The preview follows the language straight away. With Customer’s language, it uses the preview order’s language. Arabic, Hebrew, Persian and Urdu documents print right to left.
If Foliant has no wording in the document’s language, it uses your shop’s language, then English. A single word without a translation prints in English.
Format dates
Dates such ascreated_at print in a raw format. Use the date filter to format them:
Month and day names are in the document’s language:
%B prints “Januar” in a German document. To print them in another language, add it after the format, for example the customer’s: {{ created_at | date: '%A %d %B', customer_locale }}.
Times are in your shop’s time zone. {{ 'now' | date: '%d %B %Y' }} prints today’s date.
Translate wording in code templates
Use thet filter (also called translate or label) for Foliant’s wording in the document’s language:
Print two languages
Choose a Second language in the editor’s top row, then uset_both where you want both:
t_both prints one.
Translate text in visual templates
Blocks print their own wording in the document’s language. For text you write yourself (Text and Legal footer blocks with your own text, and a Header’s custom line):- Select the block and open Content.
- In Language, choose a language. Languages with a translation show “(translated)”.
- Type the text for that language.
Good to know
- The Number format in the top row decides whether money and numbers follow the document’s language (
1.234,56 €) or your store’s format. See Money and currency in templates. {{ customer_locale }}prints the customer’s language code, such asdeorfr-CA.- Templates for all the selected orders can’t use Customer’s language: a batch has many customers.
- Print in the customer’s language, under Pick the right template automatically, turns on Customer’s language for several templates at once. See Pick the right template automatically.