1. Go to <drupal>/admin/build/views/tools
2. Select – Any – for Label for “Any” value on optional single-select exposed filters:
3. Save and you can find – Any – in Translate interface.
If you don’t want to use – Any –, then you need to alter the form using hook_form_alter().
... function <module>_form_alter(&$form, $form_state, $form_id) { if($form_state['view']->name == 'your_view_name_here') { // overrides <All> on the dropdown $form['your_dropdown_name']['#options']['All'] = t('- Type -'); } }
Done =)
All this is doing for me is adding another option ‘- Type -‘ in my dropdown filter. It does not translate ‘- Any – ‘, it leaves it untouched. Any ideas? Thanks!
LikeLike
For an t() wrapped strings, you can add the translation thru the Translate Interface if you have installed the i18n module.
Have you installed the i18n module and search for the string ‘- Type -’ ?
LikeLike
I tried the Internationalization module and searched for that string but its not there.
LikeLiked by 1 person
That’s weird,.
In that case, you could determine the current language in PHP and set the translated string direct in the hook_form_alter(). For example.
Does it help?
LikeLike