Created
May 29, 2019 12:36
-
-
Save theodesp/2aaba126b02b2d48f405cceb7beb1c6d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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