function addTranslation(translations, locale) {
  if (typeof translations !== 'object') {
    return;
  }
  // add translations with format like
  // {
  //  en: {},
  //  fr: {},
  // }
  if (locale === undefined) {
    for (var key in translations) {
      addTranslation(translations[key], key);
    }
    return;
  }
  if (I18n.translations[locale] === undefined) {
    I18n.translations[locale] = translations;
  } else {
    Object.assign(I18n.translations[locale], translations);
  }
}
function addTranslation(translations, locale) {
  if (typeof translations !== 'object') {
    return;
  }
  // add translations with format like
  // {
  //  en: {},
  //  fr: {},
  // }
  if (locale === undefined) {
    for (var key in translations) {
      addTranslation(translations[key], key);
    }
    return;
  }
  if (I18n.translations[locale] === undefined) {
    I18n.translations[locale] = translations;
  } else {
    Object.assign(I18n.translations[locale], translations);
  }
}
function addTranslation ( translations , locale ) { if ( typeof translations !== 'object' ) { return ; } // add translations with format like // { //  en: {}, //  fr: {}, // } if ( locale === undefined ) { for ( var key in translations ) { addTranslation ( translations [ key ] , key ) ; } return ; } if ( I18n . translations [ locale ] === undefined ) { I18n . translations [ locale ] = translations ; } else { Object . assign ( I18n . translations [ locale ] , translations ) ; } }
addTranslation - add translations

@param  {object} translations translations object
@param  {string} locale       locale name
@returns {undefined}
addTranslation - add translations