Hello, "Search box default text" not completely working.
I wrote a text in the administration module to appear and disappear when someone click on the search box. When I do the translation of this text (translate English to French), it's display correctly on the translate page but it do not disappear when you click on the search box. More, when you delete by yourself the text (French text), it will come back to the original text in English (and then the appear/disappear work correctly but the text keep in English).

I found out that it miss a t() function in the custom_search.module at the line 156.
Need to change :

        // Default text.
        $form['default_text'] = array(
          '#type'           => 'hidden',
          '#default_value'  => variable_get('custom_search_' . $delta . 'text', ''),
          '#attributes'     => array('class' => 'default-text'),
        );

to

        // Default text.
        $form['default_text'] = array(
          '#type'           => 'hidden',
          '#default_value'  => t(variable_get('custom_search_' . $delta . 'text', ''))
          '#attributes'     => array('class' => 'default-text'),
        );

Now it work perfectly for me.

Comments

jdanthinne’s picture

Is the custom_search_i18n submodule enabled?
It should handle the translation of that field (because the t() function should be used with interface strings and not user-entered strings).

star-szr’s picture

Category: bug » support
Status: Patch (to be ported) » Closed (works as designed)