Hi Guys

When using this widget, the label in the forms doesn't show up translated, it always shows up as the original label.

Cheers

Comments

mradcliffe’s picture

Does this duplicate #1960648: Label using t() for printing, should use check_plain() with the fix in that issue, or is it just a a related issue?

jm.federico’s picture

Hi

Related, used the same title by mistake. This so that lable gets translated when needed.
The other one was because it was being printed incorrectly.

Problem here is that when using i18n_field, one can translate fields labels, but this fields label doesn't get translated.

To reproduce:

  1. Install and enable i18n_fields.
  2. Create a list field with normal list widget
  3. Translate fields label
  4. See how label gets printed translated
  5. Change widget
  6. Check widget again. Label is not translated.
mradcliffe’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Component: Documentation » Miscellaneous

Hmm, I'm not sure if I can fix this in my module. I do see some issues in i18n that have patches that may help if they were modified.

#1964234: Not all fields are translated
#1904368: [7.x-1.8 regression] Field translation fails in numerous situations

The issue is that the widget_form_alter() is only looking for #title property on the initial form element. There are some patches to look at a form element child at index 0, but it would be better if the patch used element_children(). I think if that were the case, then it would translate.

mradcliffe’s picture

Yeah, a quick hack to i18n_field_widget_form_alter() confirms that approach does work.

mradcliffe’s picture

Status: Active » Postponed

I cannot support this at the moment due to incompatibility with i18n module. As soon as i18n module fixes its implementation, then this will work for complex fields.