← Back to guides

ICU MessageFormat guide

This guide explains core ICU syntax used in modern localization pipelines.

1) Placeholders

Use a variable placeholder for direct insertion, for example Hello {name}. This is best for user names, labels, and simple runtime values.

2) Plural syntax

Use plural when a number changes grammar: {count, plural, one {# item} other {# items}}. Always include other.

3) Select syntax

Use select for keyword-based branches like role or gender: {role, select, admin {Admin panel} user {User panel} other {Home}}.

4) Selectordinal syntax

Use selectordinal for order words like 1st/2nd/3rd depending on locale rules.

5) Nesting patterns

For complex sentences, nest plural inside select (or the opposite) so grammar and quantity both stay correct.

6) Production checklist

Keep argument names stable, include fallback branches, validate early, and test with multiple locales before release.

Practice now in the online ICU message editor, validate bundles in the validator, and copy snippets from examples.