diff --git a/doc/conf/LSattribute/LSattr_html/LSattr_html_labeledValue.docbook b/doc/conf/LSattribute/LSattr_html/LSattr_html_labeledValue.docbook
index bcd7ea62..21650ea4 100644
--- a/doc/conf/LSattribute/LSattr_html/LSattr_html_labeledValue.docbook
+++ b/doc/conf/LSattribute/LSattr_html/LSattr_html_labeledValue.docbook
@@ -12,6 +12,7 @@
'label2' => 'Libellé label2',
[...]
),
+ 'translate_labels' => [booléen],
),]]>
...
@@ -28,6 +29,13 @@
+
+ translate_labels
+
+ Booléen permettant d'activer/désactiver la traduction des labels (Par defaut : Vrai).
+
+
+
diff --git a/src/includes/class/class.LSformElement_labeledValue.php b/src/includes/class/class.LSformElement_labeledValue.php
index 36c6d270..cc03dcc4 100644
--- a/src/includes/class/class.LSformElement_labeledValue.php
+++ b/src/includes/class/class.LSformElement_labeledValue.php
@@ -50,8 +50,16 @@ class LSformElement_labeledValue extends LSformElement {
foreach($this -> values as $val) {
$parseValues[]=$this -> parseValue($val);
}
+
+ // Translate labels
+ $labels = $this -> getParam('html_options.labels', array());
+ if ($this -> getParam('html_options.translate_labels', true, 'bool')) {
+ foreach($labels as $value => $label)
+ $labels[$value] = __($label);
+ }
+
$return['html'] = $this -> fetchTemplate(NULL,array(
- 'labels' => $this -> getParam('html_options.labels'),
+ 'labels' => $labels,
'parseValues' => $parseValues,
'unrecognizedValueTxt' => __('(unrecognized value)'),
'unrecognizedLabelTxt' => __('(unrecognized label)'),
diff --git a/src/includes/class/class.LSlang.php b/src/includes/class/class.LSlang.php
index 8d80ca37..fae7e6d5 100644
--- a/src/includes/class/class.LSlang.php
+++ b/src/includes/class/class.LSlang.php
@@ -626,7 +626,8 @@ function cli_generate_lang_file($command_args) {
}
break;
case 'labeledValue':
- addFromLSconfig("LSobjects.$obj.attrs.$attr.html_options.labels.*");
+ if (LSconfig :: get("LSobjects.$obj.attrs.$attr.html_options.translate_labels", True, "bool"))
+ addFromLSconfig("LSobjects.$obj.attrs.$attr.html_options.labels.*");
break;
case 'password':
addFromLSconfig("LSobjects.$obj.attrs.$attr.html_options.mail.subject");