Hello,
I'm
trying to translate the headers a table created from a table view.
I've
added this code into my template.php file:
function
enhunchbaque_views_view_table_shows($view, $nodes, $type) {
$header = array();
foreach ($view->field as $field)
{
$temp
= $field['label'];
$cell['data']=t("$temp");
$cell['class']=$field['header'];
drupal_set_message("<pre>"
. print_r($temp,true) . "</pre>");
$header[] = $cell;
}
$fields = _views_get_fields();
foreach ($nodes as $node) {
$row = array();
foreach ($view->field
as $field) {
$cell['data'] = views_theme_field('views_handle_field',
$field['queryname'], $fields, $field, $node, $view);
$cell['class']='view-field-'.$field['queryname'];
$row[] = $cell;
}
$rows[] = $row;
}
return theme('table', $header,
$rows, array('class' => 'show-table'));
}
The
code seems to run fine.
The
thing that I changed is this part
$temp
= $field['label'];
$cell['data']=t("$temp");
I'm
trying to get the headers translated using translate strings, but they don't
appear when I search.
Am
I doing something wrong?
Idan