Skip to content

Instantly share code, notes, and snippets.

@theodesp
Created May 29, 2019 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theodesp/2aaba126b02b2d48f405cceb7beb1c6d to your computer and use it in GitHub Desktop.
Save theodesp/2aaba126b02b2d48f405cceb7beb1c6d to your computer and use it in GitHub Desktop.
// Note you can define multiple lines message using an Array of Strings.
Globalize.loadMessages({
en: {
email: [
"You have {count, plural,",
" one {one new email}",
" other {{formattedCount} new emails}",
]
}
});
var en = new Globalize( "en" );
var numberFormatter = en.numberFormatter();
var taskFormatter = en.messageFormatter( "email" );
taskFormatter({
count: 10,
formattedCount: numberFormatter( 10 )
});
// > "You have 10 new emails"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment