Skip to content

Instantly share code, notes, and snippets.

@sokil
Last active January 3, 2016 04:39
Show Gist options
  • Save sokil/8410083 to your computer and use it in GitHub Desktop.
Save sokil/8410083 to your computer and use it in GitHub Desktop.
var i18n = function(messages) {
this._messages = messages || {};
this.addMessages = function(messages) {
this._messages = $.extend({}, this._messages, messages);
};
this.getMessage = function(code) {
return this._messages[code] || code;
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment