var I18n = {
}

I18n.load_translations = function(translations) {
  self.translations = translations;
}

I18n.locale = function(locale) {
  self.locale = locale;
}

I18n.translate = function() {
  var a = arguments;
  a = a[0].constructor == Array || a[0].constructor == String ? a[0] : a;
  var translation = self.translations[self.locale];
  if(a.constructor == String) {
    a = a.split('.')
  }
  for(i in a) {
    translation = translation[a[i]];
  }
  return translation;
}

I18n.t = function() {
  return this.translate.apply(this, arguments);
}
