Skip to content

Instantly share code, notes, and snippets.

@theodesp
Created May 29, 2019 12:38
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/bc1e7e466ab14068f636d3a6f41587ad to your computer and use it in GitHub Desktop.
Save theodesp/bc1e7e466ab14068f636d3a6f41587ad to your computer and use it in GitHub Desktop.
var formatter;
// Note you can define multiple lines message using an Array of Strings.
Globalize.loadMessages({
en: {
party: [
"{hostGender, select,",
" female {{from} joined {to}} at her excursion}",
" male {{from} joined {to} at his excursion}",
" other {{from} joined {to} to their excursion}",
"}"
]
}
});
formatter = Globalize( "en" ).messageFormatter( "propose" );
formatter({
from: "Maria",
to: "Alex",
hostGender: "female"
});
// > "Maria invited Alex at her excursion"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment