# ICU Message Format

> The ICU Message Format is a syntax for writing translatable messages with variables, plurals and selections.

## What is ICU message format?

The syntax for messages with placeholders, plural and select rules, for example '{count, plural, one {# file} other {# files}}'. Translators get whole sentences, and the library picks the right variant for each language.

- Topic: Internationalization
- Type: format

## Example

Wrong:

```json
{
  "inbox": "You have {count} messages"
}
```

Right:

```json
{
  "inbox": "You have {count, plural, one {# message} other {# messages}}"
}
```

The plural rule lets each language choose its own forms, and `#` is replaced with the formatted number.

## Common mistakes

- Splitting a sentence into fragments and joining them in code.
- Translating the keywords `plural`, `one` and `other` inside the message.
- Leaving out the required `other` case.

## Key points

- Messages with numbers use 'plural' syntax instead of separate keys for one and many.
- Variables are inserted as placeholders, not concatenated to translated text.

## Interview questions

### What does # mean in an ICU message?

Inside a `plural` branch, `#` is replaced with the number, formatted for the current locale.

### What is the difference between plural, select and selectordinal?

`plural` picks a form by count, `select` picks by a string value like gender, and `selectordinal` picks by ordinal like 1st or 2nd.

### Does JavaScript support ICU messages natively?

No. `Intl` has no message formatter, so i18n libraries parse ICU messages and use `Intl.PluralRules` and other `Intl` APIs inside.

## Related cards

- [Pluralization](https://wonderium.dev/web/pluralization.md)
- [Translation Keys](https://wonderium.dev/web/translation-keys.md)
- [i18n](https://wonderium.dev/web/i18n.md)

---

- Level: [Web Platform](https://wonderium.dev/web.md)
- HTML version: https://wonderium.dev/web/icu-message-format
- Last updated: 2026-11-25
