getLocaleFromObject = (obj) => {
    let locale
    if (obj && obj.scope) {
      locale = obj.scope.locale
    }
    if (obj && obj.locale) {
      locale = obj.locale
    }
    return locale
  }
searches for locale in given object