Localizing Content in the Code Editor

April 04, 2019

Any content in a code template's Body, Subject Line, or Preheader can be localized, including HTML, plain text, images, and styling elements. Start localizing a template in the code editor by wrapping the content in translation tags.

This article is about localizing content in the code editor only. To learn how to localize a visual template see the Localizing a Template article.

Markup Translatable Content with Translation Tags

Add jinja translation tags to template content

To begin localizing a template in the code editor wrap the content you want to translate in {% trans %} and {% endtrans %} tags. All content wrapped in translation tags will be pulled into the Localizations tab as translation keys.

{% 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.

Creating Localizations

After wrapping the content you wish to translate you can create localizations. There are two ways to add localizations to your template:

Translating in the Editor

Navigate to the Localizations tab to create a new localization and add translations without leaving the code editor. Check out our article Localizing a template for more on how to use the editor to create localizations.

Translating with POT and PO Files

You can also create then upload multiple localizations at once with POT and PO files. 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.

Didn't find what you're looking for?

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

Contact Support