added language support for characters and kilobytes in validator library.
This commit is contained in:
parent
c1ca97d9fb
commit
d420d1c07f
|
@ -2,6 +2,12 @@
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Validation Error Messages
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
"accepted" => "The :attribute must be accepted.",
|
"accepted" => "The :attribute must be accepted.",
|
||||||
"active_url" => "The :attribute does not exist.",
|
"active_url" => "The :attribute does not exist.",
|
||||||
"alpha" => "The :attribute may only contain letters.",
|
"alpha" => "The :attribute may only contain letters.",
|
||||||
|
@ -23,4 +29,14 @@
|
||||||
"unique" => "The :attribute has already been taken.",
|
"unique" => "The :attribute has already been taken.",
|
||||||
"url" => "The :attribute format is invalid.",
|
"url" => "The :attribute format is invalid.",
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| The following words are appended to the "size" messages when applicable,
|
||||||
|
| such as when validating string lengths or the size of file uploads.
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
"characters" => "characters",
|
||||||
|
"kilobytes" => "kilobytes",
|
||||||
|
|
||||||
);
|
);
|
|
@ -431,7 +431,9 @@ protected function get_message($attribute, $rule)
|
||||||
// the default error message appropriately.
|
// the default error message appropriately.
|
||||||
if (in_array($rule, $this->size_rules) and ! is_numeric($this->attributes[$attribute]))
|
if (in_array($rule, $this->size_rules) and ! is_numeric($this->attributes[$attribute]))
|
||||||
{
|
{
|
||||||
return (array_key_exists($attribute, $_FILES)) ? rtrim($message, '.').' kilobytes.' : rtrim($message, '.').' characters.';
|
return (array_key_exists($attribute, $_FILES))
|
||||||
|
? rtrim($message, '.').' '.Lang::line('validation.kilobytes')->get().'.'
|
||||||
|
: rtrim($message, '.').' '.Lang::line('validation.characters')->get().'.';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $message;
|
return $message;
|
||||||
|
|
Loading…
Reference in New Issue