Skip to content
F fluenti

Message Format

Fluenti uses a subset of ICU MessageFormat for message strings.

Hello World
Hello {name}, welcome to {place}!

Variables are replaced with values passed to t():

t('greeting', { name: 'Alice', place: 'Fluenti' })
// → "Hello Alice, welcome to Fluenti!"
{count, plural, =0 {No items} one {# item} other {# items}}

The # symbol is replaced with the numeric value. CLDR plural categories are: zero, one, two, few, many, other.

{gender, select, male {He} female {She} other {They}} liked your post.
Your balance is {amount, number, currency}
Last login: {date, date, short}

Use single quotes to escape special characters:

'{' renders as a literal {
'{'name'}' renders as literal {name}
'' renders as a literal '

Plurals and selects can be nested:

{count, plural,
one {{gender, select, male {He has # item} other {She has # item}}}
other {{gender, select, male {He has # items} other {She has # items}}}
}