Last active
March 25, 2017 18:44
-
-
Save lelandrichardson/fa137fcfb519bce144956a2380fc1adb to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function t(strings, ...values) { | |
const string = strings.reduce((s, next, i) => `${s}%{${i}}${next}`); | |
return new IntlMessageFormat(string, 'en-us').format(values); | |
} | |
const person = 'Mike'; | |
const age = 28; | |
console.log(t`${person} is age ${age}`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment