Feature: Provide a short title of your feature request/feedback.
Proper localization features for email templates and actions.
Description: Give us some details about your feedback/feature request. Examples, screenshots, videos, etc. are helpful.
For email templates, you currently have to use very awkward if/else or case/when structures in order to provide localized alternatives. The subject line is even more difficult to work with.
Within actions, you have to include/repeat all translations, and use some form of map to look them up.
The DX and maintenance of this is terrible.
I would suggest adding a centralized translation database/dictionary, and allowing email templates and actions to reference keys in this dictionary. The keys could be full messages or translation IDs, and the values (messages) could be written using ICU MessageFormat syntax (f.e. Hello {username}, you are {age, number} years old
).
The placeholder values could be based on available data, or you could specify the replacements when performing the translation.
There could also be ICU functions for localizing numbers and dates.
Instead of entering the subject and body with Liquid syntax (only), you could reference translation messages.
Subject: t("EMAIL_WELCOME_SUBJECT", {firstName: user.first_name})
[id-based]
Subject: t("Welcome {firstName}", {firstName: user.first_name})
[message-based]
Body:
<html>
...
<body>
t("EMAIL_WELCOME_BODY", {firstName: user.first_name})
</body>
</html>
etc.
The syntax could be more Liquid-like (f.e. using filters), but you get the idea.
Actions would also have access to this translation dictionary, for localizing error messages, etc.
The translation database could include import/export and synchronization features.
The user’s locale should be set automatically by Auth0 based on the detected locale by default, which could be overridden within an action.
Use-case: Tell us what you are building. How would the feedback/feature improve your experience?
Websites and mobile apps that support multiple languages.