diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/language/english/form_validation_lang.php | 52 | ||||
-rw-r--r-- | system/libraries/Form_validation.php | 14 |
2 files changed, 36 insertions, 30 deletions
diff --git a/system/language/english/form_validation_lang.php b/system/language/english/form_validation_lang.php index e22b3562c..a809f1fa8 100644 --- a/system/language/english/form_validation_lang.php +++ b/system/language/english/form_validation_lang.php @@ -26,32 +26,32 @@ */ defined('BASEPATH') OR exit('No direct script access allowed'); -$lang['required'] = 'The {field} field is required.'; -$lang['isset'] = 'The {field} field must have a value.'; -$lang['valid_email'] = 'The {field} field must contain a valid email address.'; -$lang['valid_emails'] = 'The {field} field must contain all valid email addresses.'; -$lang['valid_url'] = 'The {field} field must contain a valid URL.'; -$lang['valid_ip'] = 'The {field} field must contain a valid IP.'; -$lang['min_length'] = 'The {field} field must be at least {param} characters in length.'; -$lang['max_length'] = 'The {field} field cannot exceed {param} characters in length.'; -$lang['exact_length'] = 'The {field} field must be exactly {param} characters in length.'; -$lang['alpha'] = 'The {field} field may only contain alphabetical characters.'; -$lang['alpha_numeric'] = 'The {field} field may only contain alpha-numeric characters.'; -$lang['alpha_dash'] = 'The {field} field may only contain alpha-numeric characters, underscores, and dashes.'; -$lang['numeric'] = 'The {field} field must contain only numbers.'; -$lang['is_numeric'] = 'The {field} field must contain only numeric characters.'; -$lang['integer'] = 'The {field} field must contain an integer.'; -$lang['regex_match'] = 'The {field} field is not in the correct format.'; -$lang['matches'] = 'The {field} field does not match the {param} field.'; -$lang['differs'] = 'The {field} field must differ from the {param} field.'; -$lang['is_unique'] = 'The {field} field must contain a unique value.'; -$lang['is_natural'] = 'The {field} field must only contain digits.'; -$lang['is_natural_no_zero'] = 'The {field} field must only contain digits and must be greater than zero.'; -$lang['decimal'] = 'The {field} field must contain a decimal number.'; -$lang['less_than'] = 'The {field} field must contain a number less than {param}.'; -$lang['less_than_equal_to'] = 'The {field} field must contain a number less than or equal to {param}.'; -$lang['greater_than'] = 'The {field} field must contain a number greater than {param}.'; -$lang['greater_than_equal_to'] = 'The {field} field must contain a number greater than or equal to {param}.'; +$lang['form_validation_required'] = 'The {field} field is required.'; +$lang['form_validation_isset'] = 'The {field} field must have a value.'; +$lang['form_validation_valid_email'] = 'The {field} field must contain a valid email address.'; +$lang['form_validation_valid_emails'] = 'The {field} field must contain all valid email addresses.'; +$lang['form_validation_valid_url'] = 'The {field} field must contain a valid URL.'; +$lang['form_validation_valid_ip'] = 'The {field} field must contain a valid IP.'; +$lang['form_validation_min_length'] = 'The {field} field must be at least {param} characters in length.'; +$lang['form_validation_max_length'] = 'The {field} field cannot exceed {param} characters in length.'; +$lang['form_validation_exact_length'] = 'The {field} field must be exactly {param} characters in length.'; +$lang['form_validation_alpha'] = 'The {field} field may only contain alphabetical characters.'; +$lang['form_validation_alpha_numeric'] = 'The {field} field may only contain alpha-numeric characters.'; +$lang['form_validation_alpha_dash'] = 'The {field} field may only contain alpha-numeric characters, underscores, and dashes.'; +$lang['form_validation_numeric'] = 'The {field} field must contain only numbers.'; +$lang['form_validation_is_numeric'] = 'The {field} field must contain only numeric characters.'; +$lang['form_validation_integer'] = 'The {field} field must contain an integer.'; +$lang['form_validation_regex_match'] = 'The {field} field is not in the correct format.'; +$lang['form_validation_matches'] = 'The {field} field does not match the {param} field.'; +$lang['form_validation_differs'] = 'The {field} field must differ from the {param} field.'; +$lang['form_validation_is_unique'] = 'The {field} field must contain a unique value.'; +$lang['form_validation_is_natural'] = 'The {field} field must only contain digits.'; +$lang['form_validation_is_natural_no_zero'] = 'The {field} field must only contain digits and must be greater than zero.'; +$lang['form_validation_decimal'] = 'The {field} field must contain a decimal number.'; +$lang['form_validation_less_than'] = 'The {field} field must contain a number less than {param}.'; +$lang['form_validation_less_than_equal_to'] = 'The {field} field must contain a number less than or equal to {param}.'; +$lang['form_validation_greater_than'] = 'The {field} field must contain a number greater than {param}.'; +$lang['form_validation_greater_than_equal_to'] = 'The {field} field must contain a number greater than or equal to {param}.'; /* End of file form_validation_lang.php */ /* Location: ./system/language/english/form_validation_lang.php */
\ No newline at end of file diff --git a/system/libraries/Form_validation.php b/system/libraries/Form_validation.php index ecd5b18df..68534251b 100644 --- a/system/libraries/Form_validation.php +++ b/system/libraries/Form_validation.php @@ -609,7 +609,9 @@ class CI_Form_validation { { $line = $this->_error_messages[$type]; } - elseif (FALSE === ($line = $this->CI->lang->line($type))) + elseif (FALSE === ($line = $this->CI->lang->line('form_validation_'.$type)) + // DEPRECATED support for non-prefixed keys + && FALSE === ($line = $this->CI->lang->line($type, FALSE))) { $line = 'The field was not set'; } @@ -749,7 +751,9 @@ class CI_Form_validation { { if ( ! isset($this->_error_messages[$rule])) { - if (FALSE === ($line = $this->CI->lang->line($rule))) + if (FALSE === ($line = $this->CI->lang->line('form_validation_'.$rule)) + // DEPRECATED support for non-prefixed keys + && FALSE === ($line = $this->CI->lang->line($rule, FALSE))) { $line = 'Unable to access an error message corresponding to your field name.'; } @@ -797,7 +801,9 @@ class CI_Form_validation { if (sscanf($fieldname, 'lang:%s', $line) === 1) { // Were we able to translate the field name? If not we use $line - if (FALSE === ($fieldname = $this->CI->lang->line($line))) + if (FALSE === ($fieldname = $this->CI->lang->line('form_validation_'.$line)) + // DEPRECATED support for non-prefixed keys + && FALSE === ($fieldname = $this->CI->lang->line($line, FALSE))) { return $line; } @@ -807,7 +813,7 @@ class CI_Form_validation { } // -------------------------------------------------------------------- - + /** * Build an error message using the field and param. * |