Hi,

Would it be possible to support i18n for the label and button.

Simply adding a t() at a couple of place would fix the issue.

Thanks.

Comments

jdanthinne’s picture

Status: Active » Postponed (maintainer needs more info)

Support for i18n is included in the custom_search_i18n_submodule.
Which label and button are you trying to translate?

webadpro’s picture

Well, Search box Label & Submit button text.

I know its not recommended but having:

t(variable_get('custom_search_' . $delta . 'label', CUSTOM_SEARCH_LABEL_DEFAULT))
$form['actions']['submit']['#value'] = t(variable_get('custom_search_' . $delta . 'submit_text', CUSTOM_SEARCH_SUBMIT_TEXT_DEFAULT));

rather than:

variable_get('custom_search_' . $delta . 'label', CUSTOM_SEARCH_LABEL_DEFAULT)
$form['actions']['submit']['#value'] = variable_get('custom_search_' . $delta . 'submit_text', CUSTOM_SEARCH_SUBMIT_TEXT_DEFAULT);

Would do it.

jdanthinne’s picture

This is already working… I've just tested it on a fresh install.
I've entered the text strings in Custom Search settings /admin/config/search/custom_search.
Then in admin/config/regional/translate/translate, I limit the search to "Custom Search", all the strings are there, ready to be translated.

RaulMuroc’s picture

Status: Postponed (maintainer needs more info) » Active

Could you put the steps? Everything is mixed: use t() somewhere, apply sub-module Custom Search internationalitzation... would be nice to have it step-by-step.

Thanks.

RaulMuroc’s picture

Status: Active » Closed (fixed)

Nothing. Is true, Custom Search already support translation. You just have to active: Custom Search Internationalization and translate the strings through Translate UI of I18n ;-)

nick2006’s picture

Hi,
I want to use Custom search paths in the form path|label, but I can not translate labels.
Is there any way?

jdanthinne’s picture

Please open a new issue for that, please.