Only attempt to translate string values

Fixes #4398. Credit to @w20k for finding the issue.
This commit is contained in:
Luke Towers 2019-07-09 08:12:44 -06:00 committed by GitHub
parent 6f583b3920
commit f9f337e664
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -450,7 +450,11 @@ class ReportContainer extends WidgetBase
$properties = $widget->defineProperties();
foreach ($properties as $name => $params) {
$result[$name] = Lang::get($widget->property($name));
$value = $widget->property($name);
if (is_string($value)) {
$value = Lang::get($value);
}
$result[$name] = $value;
}
$result['ocWidgetWidth'] = $widget->property('ocWidgetWidth');
@ -507,4 +511,4 @@ class ReportContainer extends WidgetBase
{
return 'backend::reportwidgets.default.'.$this->context;
}
}
}