From: Jose Reyero Date: Wed, 14 Mar 2007 17:06:28 +0000 (+0000) Subject: Updated for latest changes in views DRUPAL-5 branch X-Git-Tag: 5.x-2.0~10 X-Git-Url: http://drupalcode.org/project/i18n.git/commitdiff_plain/47c571b586e51f46062ea74bf0cee1ed34e7d989 Updated for latest changes in views DRUPAL-5 branch --- diff --git a/experimental/i18ntaxonomy.install b/experimental/i18ntaxonomy.install index 2e67ba7..7119c32 100644 --- a/experimental/i18ntaxonomy.install +++ b/experimental/i18ntaxonomy.install @@ -1,14 +1,7 @@ exposed_filter[$index]['label'] = t($form['view']['#value']->exposed_filter[$index]['label']); // Translate this vocabulary terms, field name is filter$index vid = $matches[1] foreach ($form["filter$index"]['#options'] as $value => $option) { if ($value != '**ALL**') { // ALL option should be already localized - $form["filter$index"]['#options'][$value] = t($option); + // This may be an object with an option property being an array (tid => name) + if (is_object($option) && is_array($option->option)) { + foreach (array_keys($option->option) as $tid) { + $option->option[$tid] = t($option->option[$tid]); + } + $form["filter$index"]['#options'][$value] = $option; + // But it used to be a plain string, so let's keep this just in case... + } elseif(is_string($option)) { + $form["filter$index"]['#options'][$value] = t($option); + } } } } @@ -129,8 +136,6 @@ function i18ntaxonomy_views_pre_view(&$view, &$items) { } elseif(preg_match("/term_node_(\d+)\.name/", $data['id'], $matches)) { $vid = $matches[1]; if ($translate[$vid]) { - // Translate table header - // $view->table_header[$index]['data'] = t($view->table_header[$index]['data']); // Set new handler for this field $view->field[$index]['handler'] = 'i18ntaxonomy_views_handler_field_allterms'; }