Currently the options given for a list type field (e.g. on/off values for a checkbox) are never passed through the t() function, unlike the other field labels.

The perfect location for this would probably be in list_allowed_values() of field/modules/list/list.module.
In the case that an "allowed_values_function" does not exist we get original allowed values

$values = $field['settings']['allowed_values'];

and could apply t() to all values.

If we do it any later than we cannot be sure whether the allowed values came from an "allowed_values_function" and t() has been used already.
Moreover list_allowed_values() is being called for all options whether they appear in a form element or in a field formatter.

Comments

mindgame’s picture

Category: feature » bug
mindgame’s picture

StatusFileSize
new604 bytes

I'm using this patch now.

damien tournoud’s picture

Version: 7.x-dev » 8.x-dev
Category: bug » feature

Translation of field meta is handled by the i18n_field module, part of the i18n suite. Doing anything else is Drupal 8 material.

mindgame’s picture

Version: 8.x-dev » 7.x-dev
Category: feature » bug
Status: Active » Closed (works as designed)
jedward3’s picture

Issue summary: View changes

It works for me. (It requires me to uninstall and reinstall entityform, but then it worked!)