Created
May 29, 2019 12:35
-
-
Save theodesp/98d823a1d8f82b9d82db456cd003d5cd 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
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