Message Format
Fluenti uses a subset of ICU MessageFormat for message strings.
Plain text
Section titled “Plain text”Hello WorldVariables
Section titled “Variables”Hello {name}, welcome to {place}!Variables are replaced with values passed to t():
t('greeting', { name: 'Alice', place: 'Fluenti' })// → "Hello Alice, welcome to Fluenti!"Plurals
Section titled “Plurals”{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.
Select
Section titled “Select”{gender, select, male {He} female {She} other {They}} liked your post.Number formatting
Section titled “Number formatting”Your balance is {amount, number, currency}Date formatting
Section titled “Date formatting”Last login: {date, date, short}Escaping
Section titled “Escaping”Use single quotes to escape special characters:
'{' renders as a literal {'{'name'}' renders as literal {name}'' renders as a literal 'Nesting
Section titled “Nesting”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}}}}