Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a view with i18nviews module enabled. But when I disable it the same problem exists. The view labels of fields that I entered manually are not being translated. The ones that are "default" (the same as the drupal field) are translated.
When I turn this function:
/**
* Shared helper function for export preprocess functions.
*/
function _views_data_export_header_shared_preprocess(&$vars) {
$view = $vars['view'];
$fields = &$view->field;
$fields_info = $view->display_handler->get_option('fields');
$vars['header'] = array();
foreach ($fields as $key => $field) {
if (empty($field->options['exclude'])) {
if (isset($fields_info) && isset($fields_info[$key]['label'])) {
$vars['header'][$key] = check_plain($fields_info[$key]['label']);
}
else {
$vars['header'][$key] = check_plain($field->label());
}
}
}
}
Into this:
/**
* Shared helper function for export preprocess functions.
*/
function _views_data_export_header_shared_preprocess(&$vars) {
$view = $vars['view'];
$fields = &$view->field;
$fields_info = $view->display_handler->get_option('fields');
$vars['header'] = array();
foreach ($fields as $key => $field) {
if (empty($field->options['exclude'])) {
$vars['header'][$key] = check_plain($field->label());
}
}
}
Then everything works fine. So it seems like the values are translated but that somewhere along the line the wrong translations are placed into the options array. Any ideas what is going wrong?
Comments