No ESL code is needed if you use the multi-language tool that Emarsys offers. Simply place the e-language tags around the specific locales that you want to use.
Data for what to display - German or English language:
<e-language locales="de-DE">
<td align="center">
<e-optional name="nav_men">
<a e-editable="navlinkmen_DE" href="https://www.sportylife.de/DE/l/herren" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextmen_DE">Männer</font></a>
<span style="display:inline-block;width:20px;"> </span>
</e-optional>
<e-optional name="nav_women">
<a e-editable="navlinkwomen_DE" href="https://www.sportylife.de/DE/l/damen" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextwomen_DE">Frauen</font></a>
<span style="display:inline-block;width:20px;"> </span>
</e-optional>
<e-optional name="nav_kids">
<a e-editable="navlinkkids_DE" href="https://www.sportylife.de/DE/l/kinder" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextkids_DE">Kinder</font></a>
<span class="mh" style="display:inline-block;width:20px;"> </span>
</e-optional>
<span class="mh">
<e-optional name="nav_footwear">
<a e-editable="navlinkfootwear_DE" href="https://www.sportylife.de/DE/c/schuhe-alles-entdecken" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextfootwear_DE">Schuhe</font></a>
<span style="display:inline-block;width:20px;"> </span>
</e-optional>
<e-optional name="nav_clearance">
<a e-editable="navlinksale_DE" href="https://www.sportylife.de/DE/c/outdoor-outlet" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextsale_DE">Outlet</font></a>
</e-optional>
</span>
</td>
</e-language>
<e-language locales="en-BE">
<td align="center">
<e-optional name="nav_men">
<a e-editable="navlinkmen_ENBE" href="https://www.sportylife.be/ENBE/c/men" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextmen_ENBE">Men</font></a>
<span style="display:inline-block;width:20px;"> </span>
</e-optional>
<e-optional name="nav_women">
<a e-editable="navlinkwomen_ENBE" href="https://www.sportylife.be/ENBE/c/women" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextwomen_ENBE">Women</font></a>
<span style="display:inline-block;width:20px;"> </span>
</e-optional>
<e-optional name="nav_kids">
<a e-editable="navlinkkids_ENBE" href="https://www.sportylife.be/ENBE/l/kids" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextkids_ENBE">Kids</font></a>
<span class="mh" style="display:inline-block;width:20px;"> </span>
</e-optional>
<span class="mh">
<e-optional name="nav_footwear">
<a e-editable="navlinkfootwear_ENBE" href="https://www.sportylife.be/ENBE/c/footwear" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextfootwear_ENBE">Footwear</font></a>
<span style="display:inline-block;width:20px;"> </span>
</e-optional>
<e-optional name="nav_clearance">
<a e-editable="navlinksale_ENBE" href="https://www.sportylife.be/ENBE/c/outdoor-clearance" target="_blank" class="fc1 fwn tdn"><font class="ff2 fs14 fc1 fwn" e-editable="navtextsale_ENBE">Clearance</font></a>
</e-optional>
</span>
</td>
</e-language>
Use JSON
Employ json code to deal with language selection.
{% if event.locale == 'fr_CA' %}
<font e-editable="textFR" class="ff fs10 fc2">FRENCH preheader goes here.</font>
{% else %}
<font e-editable="textEN" class="ff fs10 fc2">ENGLISH preheader goes here.</font>
{% endif %}
Set groupings
A popular solution in case of more languages is to use groupings of sets in order to determine the locale and language preference all at once rather using multiple if/else
statements. Once a set has been created, just refer to later it in the code by simply calling to it as you do with other personalization in double curly brackets. In the example below, you can call to the kids navigation with the placeholder {{nav_kids}}
.
<!-- Preheader/Header Nav Blocks -->
{% if event.locale == 'fr_CA' %}
{% set txt_ShopNow = 'Magasinez dès maintenant' %}
{% set txt_ViewOnline = 'Voir dans un navigateur' %}
{% set txt_men = "Homme" %}
{% set txt_women = "Femme" %}
{% set txt_kids = "Enfant" %}
{% set txt_footwear = "Chaussures" %}
{% set txt_sale = "Soldes" %}
{% elseif event.locale == 'en_CA' %}
{% set txt_ShopNow = 'Shop Now' %}
{% set txt_ViewOnline = 'View Online' %}
{% set txt_men = "Men" %}
{% set txt_women = "Women" %}
{% set txt_kids = "Kids" %}
{% set txt_footwear = "Footwear" %}
{% set txt_sale = "Sale" %}
{% else %}
{% set txt_ShopNow = 'Shop Now' %}
{% set txt_ViewOnline = 'View Online' %}
{% set txt_women = "Women" %}
{% set txt_kids = "Kids" %}
{% set txt_footwear = "Footwear" %}
{% set txt_sale = "Sale" %}
{% endif %}
{% if event.locale == 'fr_CA' %}
<!-- Language French -->
{% set txt_pleasenote = "REMARQUE:" %}
{% set txt_storelocator = "Localisateur de magasin" %}
{% set txt_myaccount = "Mon compte" %}
{% set txt_customerservice = "Service à la clientèle" %}
{% set txt_contactus = "Communiquer avec nous" %}
{% set txt_unsub = "Se désabonner" %}
{% set txt_sentby = "Ce courriel a été envoyé par" %}
{% set txt_allrightsreserved = "Tous droits réservés" %}
{% set txt_privacypolicy = "Charte de Confidentialité" %}
{% else %}
<!-- Language English -->
{% set txt_pleasenote = "PLEASE NOTE:" %}
{% set txt_storelocator = "Store Locator" %}
{% set txt_myaccount = "My Account" %}
{% set txt_customerservice = "Customer Service" %}
{% set txt_contactus = "Contact Us" %}
{% set txt_unsub = "Unsubscribe" %}
{% set txt_sentby = "This email was sent by" %}
{% set txt_allrightsreserved = "All rights reserved" %}
{% set txt_privacypolicy = "Privacy Policy" %}
{% endif %}