If you have global users of your app, you should send messages in your users' local language. Localytics automatically detects the language from the settings on a user's device and assigns this as a profile attribute. The language is saved as a two-character code using the ISO 639-1 standard.
Language |
Code |
---|---|
English | en |
French |
fr |
Spanish |
es |
Achieving localization is very straightforward. In the same way that you achieve personalization by using profile attributes to dynamically create messages, you can include instructions that tell Localytics to send different messages based on the language setting on a user's device.
Localytics uses the open-source templating language Liquid to personalize messages. For more information, see Using Liquid.
Consider using localization to:
- Send messages in a user's native language. For example, Salut, mon amie! for users with French as their device language, Hola, mi amigo! for users with Spanish, and Hello, my friend! as the default for all other users.
{% if _ll.language == 'fr' %}
Salut, mon amie!
{% elsif _ll.language == 'es' %}
Hola, mi amigo!
{% else %}
Hello, my friend!
{% endif %}
- Send localized messages for the most common foreign languages and use fall-back logic to default to English (or another language) for everyone else.
Tip: Language is detected and assigned automatically by Localytics as a profile attribute. See Profiles to ensure you understand what profiles are, how they are set, and what else you can achieve with them.