identities: for fields using a ChoiceWidget translate the options
This commit is contained in:
parent
6d7854d860
commit
2047b39309
|
@ -217,6 +217,16 @@ class Field:
|
|||
value = keywords.pop('value', None)
|
||||
if identity:
|
||||
value = getattr(identity, self.key, value)
|
||||
if 'options' in keywords:
|
||||
# translate caption
|
||||
new_options = []
|
||||
for p in keywords['options']:
|
||||
if isinstance(p, (list, tuple)):
|
||||
p = (p[0], _(p[1]))
|
||||
else:
|
||||
p = _(p)
|
||||
new_options.append(p)
|
||||
keywords['options'] = new_options
|
||||
if not self.read_only or admin:
|
||||
if self.multivalued:
|
||||
keywords['render_br'] = False
|
||||
|
|
Reference in New Issue