labs.calibrate.be

Localized terms and views

 

When you use localized terms (terms have the same tid for all languages, but can be translated in the translate interface)
views has problems translating you terms.

This problem can be resolved by adding the following hook to you custom module

/**
* implementation of hook_views_pre_render
*/
function mymodule_views_pre_render($view) {
if ($view->name == ‘view_name’) {
foreach($view->result as $term) {
$term->term_data_name = tt(’taxonomy:term:’.$term->tid.’:name’, $term->term_data_name);
}
}
}

Category: 

Add new comment