Localizing a Template

December 23, 2017

You can manage localizations and translated content in the Localizations tab in the Template Editor. Add locales and translate content for a template using the Template Editor or manage your translation workflow outside of Dyspatch with POT and PO files. Once a template is published, localizations for each locale you've created will be available to sync via the Dyspatch APIApiDyspatch’s ‘Application Programming Interface’ allows developers to programmatically access their organization’s templates from Dyspatch..

Markup Translatable Content

Add trans tags to template content

To begin localizing a template, wrap the content you want to translate in {% trans %} and {% endtrans %} tags. All content wrapped in trans tags will be pulled into the Localizations tab to become the translation keys for which you will add your localized content.

{% trans %}Hello {{ first_name }}{% endtrans %}

Any content in a template's Body, Subject Line, or Preheader can be localized, including HTML, plain text, images, and styling elements.

Editing the content within trans tags will create a new translation key. To retrieve the translation tied to the old key, change the content within the trans tags back to the original and the old key, including its translation, will return to the Localizations tab.

Create Localizations

A localization is a version of your template with content translated for a locale. There are two ways to manage localizations with Dyspatch: Inside the Template Editor, or outside the Editor using POT and PO files.

Download a POT file to manage your translation workflow outside of Dyspatch. Read our article Localization using POT and PO files to find out how to download a POT file with content to translate, create multiple PO file localizations, and upload them all at once to Dyspatch.

Create a Localization in the Dyspatch Template Editor

Create a localization

Navigate to the Localizations tab in the Template Editor to create a new localization. Select a language and give the localization a name your team will recognize. This name is for your reference only and can follow any naming convention that works for your team.

Add Translations in the Editor

Add localized content

Select a translation key's drop-down to enter in your translated content. When a localization is selected, the Template Editor’s preview pane will show your template with its localized content.

We recommend creating a localization for the original language used in the template. This way when the localizations for a template are accessed via the API, all of the desired localizations are present, including the language in which the template was originally built.

Preview a Localization

Preview template with localized content

All localizations you’ve created are available for device previewsDevice PreviewsPreview an email template on a variety of email clients to make sure template code is working as intended. or test sending in the Preview area. Select a localization from the drop-down to view your localized template on selected devices.

Didn't find what you're looking for?

Ask our support team, we're here to help!

Contact Support