mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
Fix formatter enum translation (#2642)
* email template formatter consider enum translation * htmlizer default value for enum translation & rename variable --------- Co-authored-by: Eymen Elkum <eymen@eblasoft.com.tr>
This commit is contained in:
@@ -413,12 +413,12 @@ class Htmlizer
|
||||
);
|
||||
|
||||
if ($this->metadata) {
|
||||
$translation = $this->metadata->get(
|
||||
$translationPath = $this->metadata->get(
|
||||
['entityDefs', $entity->getEntityType(), 'fields', $attribute, 'translation']
|
||||
);
|
||||
|
||||
if ($translation) {
|
||||
$data[$attribute] = $this->language->get($translation . '.' . $data[$attribute]);
|
||||
if ($translationPath) {
|
||||
$data[$attribute] = $this->language->get($translationPath . '.' . $attribute, $data[$attribute]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,7 +73,17 @@ class Formatter
|
||||
return '';
|
||||
}
|
||||
|
||||
return (string) $this->language->translateOption($value, $attribute, $entity->getEntityType());
|
||||
$label = $this->language->translateOption($value, $attribute, $entity->getEntityType());
|
||||
|
||||
$translationPath = $this->metadata->get(
|
||||
['entityDefs', $entity->getEntityType(), 'fields', $attribute, 'translation']
|
||||
);
|
||||
|
||||
if ($translationPath) {
|
||||
$label = $this->language->get($translationPath . '.' . $value, $label);
|
||||
}
|
||||
|
||||
return $label;
|
||||
}
|
||||
|
||||
if ($fieldType === 'array' || $fieldType === 'multiEnum' || $fieldType === 'checklist') {
|
||||
|
||||
Reference in New Issue
Block a user