You are here

function i18n_taxonomy_views_pre_render in Internationalization 7

Implements hook_views_pre_render().

File

i18n_taxonomy/i18n_taxonomy.module, line 1313
i18n taxonomy module

Code

function i18n_taxonomy_views_pre_render(&$view) {
  if ($view->base_table !== 'rules_scheduler') {
    global $language;
    foreach ($view->result as $delta => $term) {
      if (isset($term->tid)) {
        i18n_string_translate_langcode($language->language);
        $localized_term = i18n_taxonomy_localize_terms(taxonomy_term_load($term->tid));
        $term->tid = $localized_term->tid;
        $term->taxonomy_term_data_name = $localized_term->name;
        $term->taxonomy_term_data_description = $localized_term->description;
      }
    }
  }
}