When displaying a checkbox in a node edit form with the setting "Use field label instead of the On value as label" the label remains untranslated.
In the options.module, function options_field_widget_form() we should change:
$element['#title'] = $instance['label'];
to
$element['#title'] = check_plain(t($instance['label']));
same as in field.form.inc for instance.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | i18n_field_callback_with_translated_instance.patch | 719 bytes | mindgame |
Comments
Comment #1
mindgame commentedWith issue http://drupal.org/node/1157426 all t() have been removed from the field system.
So here as well the t() shouldn't be used, but the problem still persists in current D7.7.
When following the correct approach for field translation using i18n_field.module the affected method options_field_widget_form() is called from i18n_field_field_widget_form().
Maybe we can use $instance_current instead of $instance for the callback?
Comment #2
czigor commentedI do not know the correct approach, but the patch is working for me, thanks!
Comment #3
jose reyero commentedLooks like a good idea. Committed. Thanks.