VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: mvladimir on April 29, 2017, 18:04:37 PM

Title: Custom field values translations in backend.
Post by: mvladimir on April 29, 2017, 18:04:37 PM
VM 3.2.1

There is a problem with translation of values of custom field in backend.

Test case:
1. Add new custom field, for instance VM_FIELD1_LABEL, field type text.
2. Add default value - VM_FIELD1_VALUE;VM_FIELD2_VALUE;VM_FIELD3_VALUE
3. Set option "Is a list?" = YES
3. Add translations in Joomla->Extensions->Languages->Overides for the label and values
4. Add custom field to some product

In the backend the label will be translated but not values

Possible solution
line 650 in administrator/components/com_virtuemart/models/customfields.php
$options[] = array('value' => $val, 'text' => $val);
has to be replaced with
$options[] = array('value' => $val, 'text' => vmText::_($val));
Title: Re: Custom field values translations in backend.
Post by: Milbo on April 29, 2017, 20:28:56 PM
We cannot translate the keys in the BE. it makes only sense to show the translation, but not to show the translated text within the edit field. Else you would override it, with the translated text