From fe61d63138f4534125e2250cc2f6809613fe9e90 Mon Sep 17 00:00:00 2001 From: Rick Ellis Date: Mon, 22 Sep 2008 21:55:12 +0000 Subject: Fixed a language bug when setting errors manually --- system/libraries/Form_validation.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'system/libraries/Form_validation.php') diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index 6ef11e345..42ce433c7 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -690,13 +690,22 @@ class CI_Form_validation { // We look for the prefix lang: to determine this if (substr($fieldname, 0, 5) == 'lang:') { - $label = $this->CI->lang->line(substr($fieldname, 5)); + $line = substr($fieldname, 5); + + $fieldname = $this->CI->lang->line($line); // Were we able to translate the field name? - $fieldname = ($label === FALSE) ? substr($fieldname, 5) : $label; + if ($fieldname === FALSE) + { + return $this->CI->lang->line($line); + } + else + { + return $label; + } } - return $fieldname; + return $this->CI->lang->line($fieldname); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b