From a1fb23a98446579659ddb73836e5b12f9bcf76e8 Mon Sep 17 00:00:00 2001 From: Farrow Date: Sat, 1 Dec 2018 19:05:47 +0000 Subject: [PATCH] Adds i18n support for the form field default property (#3546) Credit to @Farrow. Previously when creating a backend form with RainLab.Builder if you filled in the "Default" property using the i18n (to get, for example, acme.plugin::lang.field.default) then that string would be output exactly on the form (i.e. ) instead of being replaced with the actual value of that key from the lang file. --- modules/backend/widgets/Form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/backend/widgets/Form.php b/modules/backend/widgets/Form.php index c53ac92f4..c42ba56f0 100644 --- a/modules/backend/widgets/Form.php +++ b/modules/backend/widgets/Form.php @@ -1071,7 +1071,7 @@ class Form extends WidgetBase } $defaultValue = !$this->model->exists - ? $field->getDefaultFromData($this->data) + ? trans($field->getDefaultFromData($this->data)) : null; return $field->getValueFromData($this->data, $defaultValue);