drupaldrupal-6drupal-viewsdrupal-exposed-filter

How to change the label of the default value (-Any-) of an exposed filter in Drupal Views?


I created a view which has three exposed filters. Everything works fine except the fact that I can neither translate or change the default string (-Any-) for the dropdowns. Is there a way to change this string to something more meaningful like "Please Select" and make it translatable so the German version displays "Bitte wählen"? I have two screen captures that may be helpful:

the exposed filters

and

dropdown box

A further improvement would be the ability to change the text "any" to something like "please select a (field name here)" but I am losing hope for that =)

UPDATE

IMPORTANT: On further testing, I found that if you choose to display "-Any-" from "admin/build/views/tools", then THAT IS translatable.


Solution

  • Three options:

    In Drupal 7 (Drupal6 differs in details only)

    /**
     * String overrides:
     *
     * To override specific strings on your site with or without enabling locale
     * module, add an entry to this list. This functionality allows you to change
     * a small number of your site's default English language interface strings.
     *
     * Remove the leading hash signs to enable.
     */
    $conf['locale_custom_strings_en'][''] = array(
       '<Any>'      => 'Whatever!',
    );
    

    Note though, that this will change every occurrance of the full string <Any> (case sensitive) to Whatever, not just the ones in that single form.