From d6b84233edc4a80ff4543671876e1220327d8255 Mon Sep 17 00:00:00 2001 From: fmarcet Date: Tue, 18 Aug 2015 16:40:03 +0200 Subject: [PATCH] NEW: Translate extrafield's labels --- htdocs/core/class/commonobject.class.php | 4 ++-- htdocs/core/tpl/extrafields_view.tpl.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 58597862f8c..70b22d94c5e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3794,7 +3794,7 @@ abstract class CommonObject */ function showOptionals($extrafields, $mode='view', $params=null, $keyprefix='') { - global $_POST, $conf; + global $_POST, $conf, $langs; $out = ''; @@ -3852,7 +3852,7 @@ abstract class CommonObject if($extrafields->attribute_required[$key]) $label = ''.$label.''; - $out .= ''.$label.''; + $out .= ''.$langs->trans($label).''; $out .=''; switch($mode) { diff --git a/htdocs/core/tpl/extrafields_view.tpl.php b/htdocs/core/tpl/extrafields_view.tpl.php index 7100453cab5..ca8785acdfb 100644 --- a/htdocs/core/tpl/extrafields_view.tpl.php +++ b/htdocs/core/tpl/extrafields_view.tpl.php @@ -49,7 +49,7 @@ if (empty($reshook) && ! empty($extrafields->attribute_label)) print 'attribute_required[$key])) print ' class="fieldrequired"'; - print '>' . $label . ''; + print '>' . $langs->trans($label) . ''; //TODO Improve element and rights detection //var_dump($user->rights);