ICU MessageFormat is a Unicode standard that defines a structured syntax for creating dynamic, grammatically correct messages in software. It solves the problem of hard-coded string concatenation, which fails to account for the complex plural rules, gender inflection, and selection logic required by different languages. The format uses curly braces {} to define placeholders that are parsed and formatted at runtime by a dedicated library, ensuring a single source string can adapt to multiple linguistic contexts.
Glossary
ICU MessageFormat

What is ICU MessageFormat?
A Unicode technical standard providing a structured, extensible syntax for handling the grammatical and formatting complexities of different languages within software strings.
The standard supports advanced argument types like plural, select, and selectordinal, enabling a single message to handle variations such as "1 item" versus "2 items" without fragmenting the string. This moves localization logic out of brittle application code and into the translatable string itself, allowing translators to manage grammatical rules directly. By separating the message structure from the formatting logic, ICU MessageFormat is the foundational technology for achieving true internationalization (i18n) in modern, data-driven applications.
Core Features of ICU MessageFormat
The ICU MessageFormat standard provides a structured, extensible syntax for resolving the complex grammatical and formatting challenges inherent in software localization, moving far beyond simple string concatenation.
Plural & Ordinal Selection
Handles the complex plural rules of different languages using CLDR data. The plural argument type selects the correct message variant based on a numeric value and its plural category (e.g., one, few, many, other).
- Example:
{count, plural, =0 {No items} one {# item} other {# items}} - The
#token is automatically replaced with the numeric value, formatted with locale-appropriate number formatting. - Ordinal selection (
selectordinal) handles categories likeone,two,fewfor ranking strings (e.g., "1st", "2nd", "3rd").
Gender & Select Arguments
The select argument type enables gender inflection and other arbitrary keyword-based selections. It matches a provided string value against a set of explicit cases.
- Example:
{gender, select, male {He} female {She} other {They}} will reply soon. - Unlike plurals,
selectdoes not interpret the value; it performs a strict string match against the provided keys. - This mechanism is essential for languages with grammatical gender that affects surrounding adjectives and verbs.
Date, Time, & Number Formatting
Provides built-in argument types for locale-aware formatting of dates, times, and numbers without requiring pre-formatted strings.
- Numbers:
{price, number, ::currency/USD}formats a value as currency with the correct symbol and decimal separator. - Dates:
{dueDate, date, ::yyyyMMMMdd}outputs a date using locale-specific month names. - Duration:
{duration, duration, ::h:mm}formats a time interval. - These formatters use skeletons (like
::currency/USD) for precise, locale-independent control over the output pattern.
Nested & Complex Messages
MessageFormat supports arbitrary nesting of argument types, enabling the resolution of highly complex grammatical dependencies within a single translatable string.
- A plural rule can contain a
selectargument, which can itself contain another plural rule. - Example:
{count, plural, one {{gender, select, male {He has one item} female {She has one item} other {They have one item}}} other {They have # items}} - This composability allows linguists to model the full complexity of grammatical agreement without requiring developers to concatenate fragmented strings.
Quoting & Escaping Rules
A robust escaping syntax ensures that special characters used by the MessageFormat parser can appear as literal text in the output.
- Single quotes
'denote literal text:This '{curly}' is literaloutputsThis {curly} is literal. - A single quote itself is escaped by doubling it:
''. - Within a quoted sequence, all characters—including braces
{}and hash symbols#—are treated as plain text and not as syntax tokens. - This is critical for including apostrophes in languages like French and English without breaking the parser.
Custom Formatters & Extensibility
The ICU standard allows implementations to define custom formatter functions beyond the built-in number, date, and time types.
- A custom formatter is invoked using the syntax:
{value, formatterName, arg1, arg2}. - This enables domain-specific formatting like ordinal numbers (
{pos, ordinal}) or spellout ({num, spellout}). - Implementations like
intl-messageformatin JavaScript provide hooks for registering user-defined formatters, making the syntax extensible for proprietary formatting logic.
ICU MessageFormat vs. Traditional String Concatenation
A technical comparison of structured message formatting versus imperative string building for handling plurals, gender, and selection in translatable user interfaces.
| Feature | ICU MessageFormat | String Concatenation | Template Literals |
|---|---|---|---|
Plural Rules Handling | |||
Gender Inflection | |||
Select Ordinals (1st, 2nd, 3rd) | |||
Translator-Friendly Syntax | |||
Runtime Parsing Required | |||
Source String Extractability | |||
Grammatical Agreement Across Arguments | |||
Typical Bundle Size Overhead | < 5 KB | 0 KB | 0 KB |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Frequently Asked Questions
Clear, technical answers to the most common questions about the Unicode ICU MessageFormat standard, its syntax, and its role in solving complex localization challenges like pluralization and gender inflection.
ICU MessageFormat is a Unicode technical standard that provides a structured, extensible syntax for handling complex localization challenges—such as plural rules, gender inflection, and selection—directly within translatable strings. It works by embedding special formatting directives within curly braces {} inside a message string. At runtime, a formatting engine parses this syntax, evaluates the provided arguments against the rules defined in the Unicode Common Locale Data Repository (CLDR), and assembles the final, grammatically correct string. Unlike simple string concatenation or placeholder replacement, ICU MessageFormat allows a single source string to dynamically adapt its structure based on the numeric value or gender of an argument, eliminating the need for conditional logic in the application code and making the string fully translatable by linguists without developer intervention.
Related Terms
Core concepts and complementary technologies that form the foundation of modern software localization, working alongside ICU MessageFormat to handle the full spectrum of internationalization challenges.
Internationalization (i18n)
The software engineering discipline of designing codebases to be locale-independent, making ICU MessageFormat implementation possible. i18n involves:
- String externalization: Moving all user-facing text into resource files
- Locale-agnostic logic: Ensuring no hardcoded assumptions about date formats, number separators, or text direction
- Plural rule handling: Architecting data models to support languages with multiple plural forms (e.g., Arabic has six) ICU MessageFormat is the runtime expression of a well-executed i18n strategy.
Locale-Aware Formatting
The programmatic process of presenting data according to regional conventions, which ICU MessageFormat orchestrates through its select, plural, and selectordinal argument types. This encompasses:
- Number formatting:
{price, number, ::currency/USD}renders $1,234.56 or 1.234,56 € based on locale - Date formatting:
{dueDate, date, ::full}produces "Monday, January 15, 2024" or "lundi 15 janvier 2024" - List formatting: Handling Oxford commas and conjunction rules per language MessageFormat unifies these concerns into a single, parsable syntax.
Translation Management System (TMS)
A centralized platform that automates translation workflows and manages linguistic assets. TMS integration with ICU MessageFormat is critical because:
- Translators encounter structured placeholders like
{companyName}that must remain untouched - Plural forms require translators to provide all variant strings (one, few, many, other)
- Gender inflection demands context-aware translation for
{gender, select, male {he} female {she}}Modern TMS platforms parse MessageFormat syntax to present translators with guided, segmented views that prevent syntax corruption.
Bidirectional Text Rendering
The ability to correctly display mixed-direction scripts within the same paragraph—essential when ICU MessageFormat strings combine Arabic/Hebrew (RTL) with English placeholders (LTR). Challenges include:
- Embedded variables:
{userName}must render in correct visual order when surrounded by RTL text - Neutral characters: Punctuation and numbers require explicit directional markers
- Mirroring: Parentheses and brackets must flip orientation in RTL contexts ICU MessageFormat itself is direction-agnostic, but the rendering engine consuming its output must implement the Unicode Bidirectional Algorithm (UBA) to avoid garbled text.
Pseudolocalization
A pre-translation testing technique that simulates localization by transforming source strings with:
- Character expansion: Adding tildes and accents (e.g., "Hello" → "[!!! Ĥéļļö !!!]")
- Length inflation: Padding strings by 30-40% to simulate German or Finnish text expansion
- Delimiter wrapping: Adding brackets to detect string concatenation bugs Pseudolocalization stress-tests ICU MessageFormat implementations by verifying that placeholder integrity survives transformation and that UI layouts accommodate expanded plural variants without truncation or overflow.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us