Forum Discussion
Adding New Language for Braze Campaigns
- 2 years ago
Hi jgammon
The simplest way to have multiple languages in one campaign is to use liquid language. In this first example, I am using the Braze attribute 'most_recent_locale' to detect the language, and then if it is Spanish, it will display Spanish, if not, it falls back to English with the 'else' statement.{% if {{${most_recent_locale}}} == 'es_ES' %} Spanish translation goes here {% elsif {{${most_recent_locale}}} == 'pt_PT' %} Portuguese translation goes here {% else %} English translation goes here {% endif %}
To make it even simpler, you can also use {{${language}}} as the filter, but I choose 'most_recent_locale' as it filters down further to the locale of the language. For example, pt_PT (Portuguese Portugal) vs pt_BR (Portuguese Brazil) can have significant differences, rather than just using Portuguese broadly as a filter. How you approach this would need to be a business decision.
There is more info on that here:
Supported Liquid Personalization Tags (braze.com)
Another option is to store your translations in content blocks and then serve up the relevant language block in your messages. Similar liquid but it pulls in content blocks instead.{% if {{${most_recent_locale}}} == 'es_ES' %} {{content_blocks.${spanish_translation}}} {% elsif {{${most_recent_locale}}} == 'pt_PT' %} {{content_blocks.${portuguese_translation}}} {% else %} {{content_blocks.${english_translation}}} {% endif %}
I hope this helps. 😊
Hi jgammon
The simplest way to have multiple languages in one campaign is to use liquid language. In this first example, I am using the Braze attribute 'most_recent_locale' to detect the language, and then if it is Spanish, it will display Spanish, if not, it falls back to English with the 'else' statement.
{% if {{${most_recent_locale}}} == 'es_ES' %}
Spanish translation goes here
{% elsif {{${most_recent_locale}}} == 'pt_PT' %}
Portuguese translation goes here
{% else %}
English translation goes here
{% endif %}
To make it even simpler, you can also use {{${language}}} as the filter, but I choose 'most_recent_locale' as it filters down further to the locale of the language. For example, pt_PT (Portuguese Portugal) vs pt_BR (Portuguese Brazil) can have significant differences, rather than just using Portuguese broadly as a filter. How you approach this would need to be a business decision.
There is more info on that here:
Supported Liquid Personalization Tags (braze.com)
Another option is to store your translations in content blocks and then serve up the relevant language block in your messages. Similar liquid but it pulls in content blocks instead.
{% if {{${most_recent_locale}}} == 'es_ES' %}
{{content_blocks.${spanish_translation}}}
{% elsif {{${most_recent_locale}}} == 'pt_PT' %}
{{content_blocks.${portuguese_translation}}}
{% else %}
{{content_blocks.${english_translation}}}
{% endif %}
I hope this helps. 😊
- jgammon2 years agoActive Member
Thank you David, super helpful!
Related Content
- 2 years ago
- 5 months ago
- 7 months ago