Problem/Motivation

The FacetAPI Select provides a hook_i18n_string_info to inform the i18n_string module the module implements i18n_strings. However, the module does not have a hook_string_list/-objects implementation. As a result, the i18n_strings cannot be imported automatically in a continuous integration environment. Also, the admin page for refreshing i18n strings (admin/config/regional/translate/i18n_string) gives a notice:

Cannot refresh strings for FacetAPI Select.

Proposed resolution

Implement hook_string_list/-objects so the i18n_strings used by this module can imported automatically.

Remaining tasks

  1. Write a patch
  2. Review
  3. Commit

User interface changes

i18n strings used by FacetAPI Select are translated for sites built in a continuous integration environment.

API changes

None.

Data model changes

None.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review
FileSize
1.95 KB

Attached patch implements hook_i18n_string_list so 18n_strings can be imported automatically in a continuous integration environment.

idebr’s picture

Apparently the source string must be the value entered in the form for translations to be imported automatically through the translation import interface.

jlamp’s picture

Added a patch. Fixed up idebr's code a little bit -- We were trying to find ways to avoid multiple nested foreach loops, but it does seem like a necessary evil in this case.
I troubleshooted the "Cannot refresh strings for FacetAPI Select." warning, it was occuring because default values were not actually set in the facet settings, so when your code checked to see if they were empty, they were always empty unless you had specified a default value manually in the facet settings. So, no strings were sent back to i18n at all which resulted in that warning. Fixed by calling the existing functions getDefaultOptionLabel() and getResetOptionLabel() to set the defaults.

jlamp’s picture

Added in translation flags.

grndlvl’s picture

  • grndlvl committed 6aed706 on 7.x-1.x authored by idebr
    Issue #2758403 by idebr, jlamp, grndlvl: FacetAPI Select provides...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.