Translate exposed filter labels of views in drupal

Posted by: 
Dominique De Cooman

Translate exposed filter labels
Again go and get the theme_views_display_filters function out of the views.module file. Put it in your template.php file. Make sure that around every label a t function is wrapped. And that's it, go to admin/setting/locale, look up the string and translate it into the other language. (Dont forget to surf one time to the page you want to translate)

function phptemplate_views_display_filters($view) {
  $amount = count($view->exposed_filter);
  $count = 0;
  while ($count < $amount) {
    $view->exposed_filter[$count]['label'] = t($view->exposed_filter[$count]['label']);//here a t function is wrapped around the labels
  return drupal_get_form("views_filters", $view);


Translate exposed filter labels of views in drupal

Thanks a lot this was really helpful!!!!!!!

Add new comment

Who are you?

By knowing who you are you will be directed to a page where we have displayed all our drupal services relevant to your professional identity.