Last active
August 29, 2015 14:04
-
-
Save tylerjohnst/201f19159bba426096d4 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
window.I18n = { | |
pushDictionary: function(translations) { | |
I18n.translations = Ember.Object.create(translations); | |
}, | |
t: function(key, opts) { | |
var translation = I18n.translations.get('en.' + key); | |
opts = opts || {}; | |
if ( Ember.isEmpty(translation) ) { | |
return opts.default || "[ missing translation for '%@' ]".fmt(key); | |
} else { | |
return translation; | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment