I18n email templates with lots of locales

We use the liquid syntax for email internationalization but it’s very painful because we have 15 locales :

{% if user.user_metadata.lang == 'es' %}
  Hola {{ user.name }}, ...
{% elsif user.user_metadata.lang == 'it' %}
  Ciao {{ user.name }}, ...
{% else %}
  Hi {{ user.name }}, ...
... 12 more if...
{% endif %}

Is it possible to use the t filter like in shopify : Storefront locale files and upload the locale json files via the api management ? Is there any other solution for lot of locales ?

4 Likes