Skip to main content
Skip table of contents

Action translations + ICU formatting

Action ICU formatting

Messages attached to actions can be configured to use ICU Message Formatting. This is done by toggling the Message Type button group to Advanced when configuring the action:

ICU Message Formatting lets you write messages that automatically adjust based on the data they use. For instance, you can make a message say “1 mile per hour” or “2 miles per hour” depending on the speed value. This means you can create smart, flexible templates that phrase sentences correctly without extra code. This is especially helpful when your messages need to sound natural in different situations or languages.

Take two examples of pluralization in English:

  • If the speed of the truck is 1 mph, it’s correct to say “Truck ‘Flatbed01’ is going 1 mile per hour”.

  • If the speed of the truck is going any other speed than 1 mph, it’s correct to say “Truck ‘Flatbed01’ is going n miles per hour”, where n is the speed of the truck.

With ICU Message Formatting, this is achieved via the following string:

CODE
Truck "{triggerMessage.label}" is going {triggerMessage.custom_data.speed, plural, 
  one {# mile per hour} 
  other {# miles per hour}}.

After toggling the action’s message type to Advanced, the message can now be configured to use this formatting. The end result, when configured within the action, looks like the following:

image-20251009-225411.png

With these pattern strings, the action’s message will adapt its own grammar to fit the values of the variables passed, in this case triggerMessage.custom_data.speed and condition1.value.

Email and SMS action translations

The Send Email and Send SMS actions can be configured to have multiple versions of the same message in different languages, currently English and French.

Note: the following guide features examples from the Send Email action type. This looks identical to the Send SMS action, except that the Send SMS action lacks a Subject line.

To configure these translations, first toggle the Message Type to Advanced:

This will immediately open with the English language as the first option. You can configure the English version of the Email to have its own subject and message. Note: the text much conform to valid ICU Message Formatting syntax; see the Action ICU formatting section for more information.

image-20251009-225939.png

Then, to add a version of the action’s message in a different language, hit the Add button (image-20251009-230111.png) at the top-right of the Message versions section, and select the language to add:

image-20251009-230539.png

You can now fill in the same values in the language of your choice:

image-20251009-230757.png

Next, click Save in the bottom-right corner of the dialog box to save the changes to the action:

With this configuration, users will receive either the English or French templates, depending on their individual language preferences. The English-speaking user will see this email:

image-20251009-231402.png

Whereas the French-speaking user will see this email:

image-20251009-231512.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.