original_string: protected function translateColumnNames($names)
      {
          if (!$this->apiMethod) {
              return $names;
          }
  
          // load the translations only once
          // when multiple dates are requested (date=...,...&period=day), the meta data would
          // be loaded lots of times otherwise
          if ($this->columnTranslations === false) {
              $meta = $this->getApiMetaData();
              if ($meta === false) {
                  return $names;
              }
  
              $t = Metrics::getDefaultMetricTranslations();
              foreach (array('metrics', 'processedMetrics', 'metricsGoal', 'processedMetricsGoal') as $index) {
                  if (isset($meta[$index]) && is_array($meta[$index])) {
                      $t = array_merge($t, $meta[$index]);
                  }
              }
  
              foreach (Dimension::getAllDimensions() as $dimension) {
                  $dimensionId   = str_replace('.', '_', $dimension->getId());
                  $dimensionName = $dimension->getName();
  
                  if (!empty($dimensionId) && !empty($dimensionName)) {
                      $t[$dimensionId] = $dimensionName;
                  }
              }
  
              $this->columnTranslations = & $t;
          }
  
          foreach ($names as &$name) {
              if (isset($this->columnTranslations[$name])) {
                  $name = $this->columnTranslations[$name];
              }
          }
  
          return $names;
      }
code: protected function translateColumnNames($names)
      {
          if (!$this->apiMethod) {
              return $names;
          }
  
          // load the translations only once
          // when multiple dates are requested (date=...,...&period=day), the meta data would
          // be loaded lots of times otherwise
          if ($this->columnTranslations === false) {
              $meta = $this->getApiMetaData();
              if ($meta === false) {
                  return $names;
              }
  
              $t = Metrics::getDefaultMetricTranslations();
              foreach (array('metrics', 'processedMetrics', 'metricsGoal', 'processedMetricsGoal') as $index) {
                  if (isset($meta[$index]) && is_array($meta[$index])) {
                      $t = array_merge($t, $meta[$index]);
                  }
              }
  
              foreach (Dimension::getAllDimensions() as $dimension) {
                  $dimensionId   = str_replace('.', '_', $dimension->getId());
                  $dimensionName = $dimension->getName();
  
                  if (!empty($dimensionId) && !empty($dimensionName)) {
                      $t[$dimensionId] = $dimensionName;
                  }
              }
  
              $this->columnTranslations = & $t;
          }
  
          foreach ($names as &$name) {
              if (isset($this->columnTranslations[$name])) {
                  $name = $this->columnTranslations[$name];
              }
          }
  
          return $names;
      }
code_tokens: protected function translateColumnNames ( $ names ) { if ( ! $ this -> apiMethod ) { return $ names ; } // load the translations only once // when multiple dates are requested (date=...,...&period=day), the meta data would // be loaded lots of times otherwise if ( $ this -> columnTranslations === false ) { $ meta = $ this -> getApiMetaData ( ) ; if ( $ meta === false ) { return $ names ; } $ t = Metrics :: getDefaultMetricTranslations ( ) ; foreach ( array ( 'metrics' , 'processedMetrics' , 'metricsGoal' , 'processedMetricsGoal' ) as $ index ) { if ( isset ( $ meta [ $ index ] ) && is_array ( $ meta [ $ index ] ) ) { $ t = array_merge ( $ t , $ meta [ $ index ] ) ; } } foreach ( Dimension :: getAllDimensions ( ) as $ dimension ) { $ dimensionId = str_replace ( '.' , '_' , $ dimension -> getId ( ) ) ; $ dimensionName = $ dimension -> getName ( ) ; if ( ! empty ( $ dimensionId ) && ! empty ( $ dimensionName ) ) { $ t [ $ dimensionId ] = $ dimensionName ; } } $ this -> columnTranslations = & $ t ; } foreach ( $ names as & $ name ) { if ( isset ( $ this -> columnTranslations [ $ name ] ) ) { $ name = $ this -> columnTranslations [ $ name ] ; } } return $ names ; }
docstring: Translate column names to the current language.
  Used in subclasses.
  
  @param array $names
  @return array
docstring_tokens: Translate column names to the current language . Used in subclasses .