dist/vuex-i18n.es.js
function flattenTranslations(translations) {
  var toReturn = {};

  for (var i in translations) {
    // check if the property is present
    if (!translations.hasOwnProperty(i)) {
      continue;
    } // get the type of the property


    var objType = _typeof(translations[i]); // allow unflattened array of strings


    if (isArray(translations[i])) {
      var count = translations[i].length;

      for (var index = 0; index < count; index++) {
        var itemType = _typeof(translations[i][index]);

        if (itemType !== 'string') {
          console.warn('i18n:', 'currently only arrays of strings are fully supported', translations[i]);
          break;
        }
      }

      toReturn[i] = translations[i];
    } else if (objType == 'object' && objType !== null) {
      var flatObject = flattenTranslations(translations[i]);

      for (var x in flatObject) {
        if (!flatObject.hasOwnProperty(x)) continue;
        toReturn[i + '.' + x] = flatObject[x];
      }
    } else {
      toReturn[i] = translations[i];
    }
  }

  return toReturn;
}
function flattenTranslations(translations) {
  var toReturn = {};

  for (var i in translations) {
    // check if the property is present
    if (!translations.hasOwnProperty(i)) {
      continue;
    } // get the type of the property


    var objType = _typeof(translations[i]); // allow unflattened array of strings


    if (isArray(translations[i])) {
      var count = translations[i].length;

      for (var index = 0; index < count; index++) {
        var itemType = _typeof(translations[i][index]);

        if (itemType !== 'string') {
          console.warn('i18n:', 'currently only arrays of strings are fully supported', translations[i]);
          break;
        }
      }

      toReturn[i] = translations[i];
    } else if (objType == 'object' && objType !== null) {
      var flatObject = flattenTranslations(translations[i]);

      for (var x in flatObject) {
        if (!flatObject.hasOwnProperty(x)) continue;
        toReturn[i + '.' + x] = flatObject[x];
      }
    } else {
      toReturn[i] = translations[i];
    }
  }

  return toReturn;
}
function flattenTranslations ( translations ) { var toReturn = { } ; for ( var i in translations ) { // check if the property is present if ( ! translations . hasOwnProperty ( i ) ) { continue ; } // get the type of the property var objType = _typeof ( translations [ i ] ) ; // allow unflattened array of strings if ( isArray ( translations [ i ] ) ) { var count = translations [ i ] . length ; for ( var index = 0 ; index < count ; index ++ ) { var itemType = _typeof ( translations [ i ] [ index ] ) ; if ( itemType !== 'string' ) { console . warn ( 'i18n:' , 'currently only arrays of strings are fully supported' , translations [ i ] ) ; break ; } } toReturn [ i ] = translations [ i ] ; } else if ( objType == 'object' && objType !== null ) { var flatObject = flattenTranslations ( translations [ i ] ) ; for ( var x in flatObject ) { if ( ! flatObject . hasOwnProperty ( x ) ) continue ; toReturn [ i + '.' + x ] = flatObject [ x ] ; } } else { toReturn [ i ] = translations [ i ] ; } } return toReturn ; }
flattenTranslations will convert object trees for translations into a single-depth object tree
flattenTranslations will convert object trees for translations into a single - depth object tree