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
- Write a patch
- Review
- 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.
Comment | File | Size | Author |
---|---|---|---|
#6 | facetapi_select_hook_i18n_string_list-2758403-6.patch | 6.7 KB | grndlvl |
Comments
Comment #2
idebr CreditAttribution: idebr at One Shoe commentedAttached patch implements hook_i18n_string_list so 18n_strings can be imported automatically in a continuous integration environment.
Comment #3
idebr CreditAttribution: idebr at One Shoe commentedApparently the source string must be the value entered in the form for translations to be imported automatically through the translation import interface.
Comment #4
jlamp CreditAttribution: jlamp at GollyGood Software commentedAdded 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.
Comment #5
jlamp CreditAttribution: jlamp at GollyGood Software commentedAdded in translation flags.
Comment #6
grndlvl CreditAttribution: grndlvl at GollyGood Software for Zivtech commented