The file field's description is passed through the 'file_upload_help' theme hook when its widget is added to a form. Depending on whether the form element's description equals to the original field's description after calling this theme hook, i18n_field may or may not replace the element's description with its translated version.

However, this approach might fail when a theme defines a "file_upload_help" theme hook that includes HTML with "id" attributes. An example is the Bootstrap theme with the popover enabled. It adds an "id" attribute and a "data-target" attribute pointing to it. As this "id" is generated by a drupal_html_id() call, its exact value changes every time the theme hook is used. This small change on the HTML, in turn, causes the comparison made by i18n_field to fail and the field's description to not be translated.

The code that implements this behavior can be found around the line 254 of the i18n_field.module file.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dbiscalchin created an issue. See original summary.

genellann’s picture

Here's a patch. I made it on version 1.26