code: protected function localize(ContentfulItem $entry, $locale)
      {
          $fields = array();
          foreach ($entry->getFields() as $k => $v) {
              $localValue = isset($v[$locale]) ? $v[$locale] : null;
              if ($localValue === null) {
                  if (isset($v[$this->defaultLocale])) {
                      $localValue = $v[$this->defaultLocale];
                  }
              }
              if (is_null($localValue)) {
                  continue;
              }
              if (is_scalar($localValue) && trim($localValue) === "") {
                  continue;
              }
              $fields[$k] = $localValue;
          }
          return $fields;
      }
docs: @param ContentfulItem $entry
  @param                $locale
  
  @return array