Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
d420d1c0
Commit
d420d1c0
authored
Jul 22, 2011
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added language support for characters and kilobytes in validator library.
parent
c1ca97d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
validation.php
application/lang/en/validation.php
+16
-0
validator.php
system/validator.php
+3
-1
No files found.
application/lang/en/validation.php
View file @
d420d1c0
...
...
@@ -2,6 +2,12 @@
return
array
(
/*
|--------------------------------------------------------------------------
| Validation Error Messages
|--------------------------------------------------------------------------
*/
"accepted"
=>
"The :attribute must be accepted."
,
"active_url"
=>
"The :attribute does not exist."
,
"alpha"
=>
"The :attribute may only contain letters."
,
...
...
@@ -23,4 +29,14 @@ return array(
"unique"
=>
"The :attribute has already been taken."
,
"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"
,
);
\ No newline at end of file
system/validator.php
View file @
d420d1c0
...
...
@@ -431,7 +431,9 @@ class Validator {
// the default error message appropriately.
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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment