Edit ICU message and see how it will look after processing. Learn more
Samples:
0 characters
=
0 characters
*The parsing & preview are done with formatjs. Other libraries may give different results.
If you find this tool helpful, please share it with others
The ICU Message Editor is a free online tool that lets you validate ICU messages and preview their output. Simply paste or type your ICU message into the editor, and it will automatically display the formatted output for the selected language. If the message contains invalid ICU syntax, the tool will display an error instead.
To escape characters that have special meaning in ICU messages, such as {, }, and #, wrap them in apostrophes ('). See the examples below.
They count different strings:
Input count: The number of characters in the raw ICU message. This tells you how long the message is and can help you spot overly complex ICU messages or heavy syntax.
Output count: The number of characters in the final text displayed to the user after the ICU message is processed. This tells you how long the rendered UI text is once variables are resolved, and can help you identify potential truncation risks, unexpected line breaks, insufficient button width, and similar issues.
The ICU Message Editor validates ICU syntax and highlights a wide range of errors, including malformed or empty placeholders, missing or unmatched braces, invalid placeholder types, styles, or skeletons, missing required plural or select clauses (such as other), malformed or unbalanced tags, and other common ICU syntax errors.
In plural, select, and selectordinal ICU messages, the other clause is required. Omitting it will cause an error.
In plural and selectordinal messages, other handles values that don’t match a specific category (such as one, few, etc.), ensuring the message remains grammatically correct.
In select messages, other serves as a required fallback. Even if you believe you don't need it because your message only supports a predefined set of values, having a fallback is still helpful as your code evolves. It can prevent your app from breaking in the future if a new or unexpected value is introduced and you forget to add a corresponding case.
To render rich-text placeholders (tags) properly, you typically need to provide a rendering function (or component) that defines how each tag should be displayed. To avoid unnecessary complexity in this tool, we render rich-text placeholder values as plain text. In your app, you can define exactly how those tags should be rendered.