Hello,

The Default Option Label doesn't appear to be translatable with a user-provided value. For example, my option label for a filter set is Content Type; that string doesn't appear as translatable. I noticed a similar report at https://www.drupal.org/node/2322939, and that according to that issue, it had been wrapped with t() to make it translatable. It looks like this is referring to this line:

$default_option_label = !empty($settings->settings['default_option_label']) ? filter_xss_admin($settings->settings['default_option_label']) : t('--Choose--');

But that wouldn't make any user-provided values translatable.

Am I misunderstanding how to translate this value?

Thanks,
Kat

Comments

webbykat created an issue. See original summary.

webbykat’s picture

grndlvl’s picture

Hrmm... OK, so you can still do this but it's not quite as nice. We might want to integrate with i18n_string for this, however, you could have custom text by not setting the custom text via the fact block settings and using https://www.drupal.org/project/stringoverrides and still maintain the ability to translate the text.

grndlvl’s picture

Category: Bug report » Feature request
thepanz’s picture

Status: Active » Needs review
StatusFileSize
new4.45 KB

Patch added

grndlvl’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new6.38 KB

thePanz,

I have looked this over and all works and looks great. I made some minor cosmetic changes. Let me know if I messed anything up.

I will go ahead and commit to 7.x-1.x and I'll give it until next week to roll a new release.

Note: The i18n_strings module will need to be enabled. Also, to people who will be using this if you already have custom Default/Reset labels you will need to re-save the facet configuration form for the strings to show up in the translation interface.

Thanks,

Jonathan

  • grndlvl committed f7621fa on 7.x-1.x
    Issue #2688465 by thePanz, grndlvl: Default Option Label not...
grndlvl’s picture

Status: Reviewed & tested by the community » Closed (fixed)
thepanz’s picture

Thanks @grndlvl!