FIX translation in select unit form
This commit is contained in:
parent
f0dc2df526
commit
fccea99e23
@ -3388,13 +3388,19 @@ class Form
|
||||
|
||||
while($res = $this->db->fetch_object($resql))
|
||||
{
|
||||
$unitLabel = $res->label;
|
||||
if (! empty($langs->tab_translate['unit'.$res->code])) // check if Translation is available before
|
||||
{
|
||||
$unitLabel = $langs->trans('unit'.$res->code)!=$res->label?$langs->trans('unit'.$res->code):$res->label;
|
||||
}
|
||||
|
||||
if ($selected == $res->rowid)
|
||||
{
|
||||
$return.='<option value="'.$res->rowid.'" selected>'.($langs->trans('unit'.$res->code)!=$res->label?$langs->trans('unit'.$res->code):$res->label).'</option>';
|
||||
$return.='<option value="'.$res->rowid.'" selected>'.$unitLabel.'</option>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$return.='<option value="'.$res->rowid.'">'.($langs->trans('unit'.$res->code)!=$res->label?$langs->trans('unit'.$res->code):$res->label).'</option>';
|
||||
$return.='<option value="'.$res->rowid.'">'.$unitLabel.'</option>';
|
||||
}
|
||||
}
|
||||
$return.='</select>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user