Skip to content

Instantly share code, notes, and snippets.

@theodesp
Created May 29, 2019 12:35
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/98d823a1d8f82b9d82db456cd003d5cd to your computer and use it in GitHub Desktop.
Save theodesp/98d823a1d8f82b9d82db456cd003d5cd to your computer and use it in GitHub Desktop.
Globalize.loadMessages({
en: {
hello: "Hello, {0} {1}",
hey: "Hey, {prefix} {last}"
},
'el': {
hello: "Γιά σας, {0} {1}",
hey: "Γιά σου, {prefix} {last}"
}
});
formatter = Globalize( "el" ).messageFormatter( "hello" );
formatter([¨κυρία¨, "Ανδρέου"]);
// > "Γιά σας, κυρία Ανδρέου"
// Named variables using Object key-value pairs.
formatter = Globalize( "en" ).messageFormatter( "hey" );
formatter({
prefix : "Mr",
last: "Andrew"
});
// > "Hey, Mr Andrew"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment