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.

Comments

mindgame’s picture

Project: Drupal core » Internationalization
Version: 7.x-dev » 7.x-1.0-rc3
Component: field system » Fields
StatusFileSize
new719 bytes

With 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?

czigor’s picture

I do not know the correct approach, but the patch is working for me, thanks!

jose reyero’s picture

Status: Active » Fixed

Looks like a good idea. Committed. Thanks.

Status: Fixed » Closed (fixed)

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