Skip to content

Instantly share code, notes, and snippets.

@Stuk
Created October 15, 2013 17:35
Show Gist options
  • Save Stuk/6995444 to your computer and use it in GitHub Desktop.
Save Stuk/6995444 to your computer and use it in GitHub Desktop.
var defaultLocalizer = require("montage/core/localizer").defaultLocalizer;
defaultLocalizer.localize("hello_name", "Hello, {name}!")
.then(function (hi) {
console.log(hi({name: "World"})); // => "Hello, World!", or the translation at the "hello_name" key
});
defaultLocalizer.localize("cat", "Cat")
.then(function (cat) {
console.log(cat.toString()); // => "Cat", or the translation at the "cat" key
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment