From fccea99e23fd16f5cfed56db3f28b83e1bcfeae3 Mon Sep 17 00:00:00 2001 From: John BOTELLA Date: Wed, 24 Oct 2018 10:23:27 +0200 Subject: [PATCH] FIX translation in select unit form --- htdocs/core/class/html.form.class.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 0ed036f1d1f..cebd49737e5 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -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.=''; + $return.=''; } else { - $return.=''; + $return.=''; } } $return.='';