From e8af118657987717d42535a06c92388e597acc0b Mon Sep 17 00:00:00 2001
From: JediKev <kevin@enhancesoft.com>
Date: Mon, 6 Nov 2017 15:00:44 -0600
Subject: [PATCH] issue: Local Names In Validation Errors

This addresses an issue on the forums where the field names in validation
errors are not translated. This adds the correct method to retrieve the
local field names for the errors.
---
 include/class.forms.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/class.forms.php b/include/class.forms.php
index c097dd995..7821c43cb 100644
--- a/include/class.forms.php
+++ b/include/class.forms.php
@@ -670,8 +670,8 @@ class FormField {
         # Validates a user-input into an instance of this field on a dynamic
         # form
         if ($this->get('required') && !$value && $this->hasData())
-            $this->_errors[] = $this->getLabel()
-                ? sprintf(__('%s is a required field'), $this->getLabel())
+            $this->_errors[] = $this->getLocal('label')
+                ? sprintf(__('%s is a required field'), $this->getLocal('label'))
                 : __('This is a required field');
 
         # Perform declared validators for the field
-- 
GitLab