Note: translation line in views filters

CMS Blog image

What’s the question?

Web developers have asked me many times how to translate element <Any> in drop-down list in filter of views module.

Yes! It can’t be done in a standard way by interface translation.

Why?

The secret is in views_handler_filter.inc file.

$any_label = variable_get('views_exposed_filter_any_label', 'old_any') == 'old_any' ? '<Any>' : t('- Any -');

Decision option. 

First, the most popular and inaccurate method because module must hack (people don’t think of the kittens!): 

Second option, to add a line into settings.php:

$conf['views_exposed_filter_any_label'] = 'new_label';

After that, go to interface translation and look for it :)