Compare commits

...

239 Commits

Author SHA1 Message Date
Willem Wollebrants
fadce39f5f
Merge pull request #365 from blueyestar/master
added missing translation for zh-cn and zh-tw
2022-10-14 13:54:24 +02:00
Willem Wollebrants
5659b0a942
Merge pull request #364 from metakin/fix-typo
typo fix
2022-10-14 13:53:54 +02:00
Willem Wollebrants
fdc64d193a
Merge pull request #359 from mehdihasanpour/add-persian
add persian language
2022-10-14 13:52:39 +02:00
Willem Wollebrants
0cbc5834b0
Merge pull request #350 from eugene-borovov/requirewith-dot-notation
Added dot notation to requireWith(out)
2022-10-14 13:52:03 +02:00
Justin Li
1b86b4f454 added missing translation for zh-cn and zh-tw 2022-10-11 11:56:38 -04:00
metakin
fbb596d220 typo fix 2022-10-11 03:22:02 +03:00
Willem Wollebrants
57a9f68f22
Merge pull request #363 from Tautve/issue_357
Fixed Issue #357
2022-10-03 09:50:30 +02:00
tautvydaskarvelis
fd902d1def Issue #357 2022-10-01 10:06:52 +03:00
mehdi hasanpour
ac960d625f add persian language 2022-07-02 15:59:33 +04:30
Willem Wollebrants
d0fb8ee84c
Merge pull request #354 from aldinhro/patch-1
Update sv.php
2022-03-16 10:16:07 +01:00
Aldin Hro
94c97e3e8e
Update sv.php
Added correct translations
2022-03-16 10:10:25 +01:00
Willem Wollebrants
9bf11f4374
Merge pull request #351 from hiroy/add-japanese-messages
Add Japanese messages for some rules
2021-12-07 09:05:12 +01:00
Hiroyuki Yamaoka
b619ef16ba Add Japanese messages for some rules 2021-12-07 14:18:08 +09:00
Eugene Borovov
b4e0d07495 Added dot notation to requireWith(out) 2021-11-21 01:55:32 +07:00
Willem Wollebrants
5ebd5d7af8
Merge pull request #344 from vlucas/issue-326
Test against PHP 8
2021-07-08 18:18:03 +02:00
Willem Wollebrants
f189549d2d make tests compatible with phpunit for php8 2021-07-07 11:55:52 +02:00
Willem Wollebrants
fe2ca630fb make tests compatible with phpunit for php8 2021-07-07 11:52:59 +02:00
Willem Wollebrants
035eca3093 make tests compatible with phpunit for php8 2021-07-07 11:47:59 +02:00
Willem Wollebrants
da91bdea70 make tests compatible with phpunit for php8 2021-07-07 11:44:08 +02:00
Willem Wollebrants
ba90097aa5
Merge pull request #343 from vlucas/issue-332
detect numeric array when keys are out of order , fixes #332
2021-07-06 14:22:56 +02:00
Willem Wollebrants
d12a77deed check first (#332) 2021-07-06 14:16:59 +02:00
Willem Wollebrants
be8cb9e074 add parameter to force in and listContains to look at array keys 2021-07-06 10:58:22 +02:00
Willem Wollebrants
500472808c detect numeric array when keys are out of order (#332) 2021-07-05 22:14:24 +02:00
Willem Wollebrants
567fbb9965
Merge pull request #340 from euantorano/patch-1
Update build status badge
2021-07-05 18:42:08 +02:00
Willem Wollebrants
ae5a778541
Merge pull request #342 from vlucas/issue-328
Correct label for 'length' in zh-cn (#328)
2021-07-05 18:41:34 +02:00
Willem Wollebrants
1c0674c23f Correct label for 'length' in zh-cn (#328) 2021-07-05 18:40:18 +02:00
Willem Wollebrants
4c7d0070dd
Merge pull request #341 from vlucas/issue-335
add missing assertion to testNotInInvalidAltSyntax (#335)
2021-07-05 18:34:54 +02:00
Willem Wollebrants
33148fa4ed add missing assertion to testNotInInvalidAltSyntax (#335) 2021-07-05 18:33:50 +02:00
Euan Torano
f0c48c4adf
Update build status badge
As GitHub Actions now runs CI, the build status badge must be from GitHub Actions.
2021-07-05 17:29:12 +01:00
Willem Wollebrants
0282ca420b
Merge pull request #338 from euantorano/feature/github-actions
Fixed #337 - add GitHub Actions workflow to run tests
2021-07-05 18:25:56 +02:00
Euan Torano
5deb47049a Added GitHub workflow file, removed Travis CI file. Changed how email DNS validation works to only check MX record. 2021-06-17 13:01:49 +01:00
Vance Lucas
f7e662e3c0
Merge pull request #334 from joebordes/sonarqube
merge IF statement with enclosing one (sonarqube static analysis)
2021-05-12 14:47:47 -05:00
joebordes
6b3c5ae608 merge IF statement with enclosing one (sonarqube static analysis) 2021-05-12 21:21:46 +02:00
Willem Wollebrants
81515dcc95
Merge pull request #325 from TomOudeRengerink/disable-auto-prepend-field-label
Allow disabling of auto prepending the field labels.
2020-12-01 12:14:45 +01:00
Tom Oude Rengerink
9f29a1b99a Added test for prepending field labels 2020-10-26 12:45:34 +01:00
Tom Oude Rengerink
bfa24585de Changed method name for readability and writting some docs. 2020-10-23 16:29:08 +02:00
Tom Oude Rengerink
6a6810e25c Removed some PHP Doc blocks generated by IDEA 2020-10-23 16:16:25 +02:00
Tom Oude Rengerink
128097ea16 Allow disabling of auto prepending the field labels shown in the error message. 2020-10-23 16:11:20 +02:00
Willem Wollebrants
9268adeeb4
Merge pull request #316 from euantorano/patch-1
Fix invalid opening bracket for arrayHasKeys example
2020-07-10 10:55:05 +02:00
Euan
a204228146
Fix mismatched open array for arrayHasKeys. 2020-07-07 16:08:30 +01:00
Willem Wollebrants
4af076d19f
Merge pull request #312 from PowerPan/sl
Add SL
2020-05-14 16:50:07 +02:00
Johannes Rudolph
3d2b0ef5f7 Add SL 2020-05-04 13:34:58 +02:00
Willem Wollebrants
43e9393009
Merge pull request #310 from sergiy-petrov/patch-1
test agains php 7.4
2020-03-05 20:31:19 +01:00
sergiy-petrov
7747441139
test agains php 7.4 2020-03-05 15:30:36 +02:00
Willem Wollebrants
87f830e554
Merge pull request #306 from vlucas/optionals
make selection of which rules to run more clear
2020-02-14 15:19:19 +01:00
Willem Wollebrants
cb2787cfcc make selection of which rules to run more clear 2020-02-14 15:08:39 +01:00
Willem Wollebrants
2baace22d8 correct documentation for integer strict mode, see #302 2020-02-14 09:44:44 +01:00
Vance Lucas
d0134c33d2
Merge pull request #293 from aecy/master
update: more french added
2019-10-24 09:46:33 -05:00
aecyM^
b7c5c09912
update: more french added 2019-09-07 15:12:40 +02:00
Vance Lucas
849d7e7dfb
Add Tidelife support message 2019-08-29 16:21:26 -05:00
Vance Lucas
47af606520
Add Security notice 2019-08-29 16:18:29 -05:00
Willem Wollebrants
a03072bed1
Merge pull request #267 from mangopeaches/required-conditionals
Adding requiredWith and requiredWithout conditional rules
2019-08-29 21:49:43 +02:00
Willem Wollebrants
76e44188e2
Merge pull request #284 from tobiashinz/listContains
List contains
2019-08-21 12:16:21 +02:00
Willem Wollebrants
89117a92f6
Update .travis.yml 2019-08-15 16:56:21 +02:00
Willem Wollebrants
ec7a20dd50
Update .travis.yml 2019-08-15 16:47:07 +02:00
Willem Wollebrants
f87d5b1905
Merge branch 'master' into listContains 2019-08-15 16:37:50 +02:00
Willem Wollebrants
4cf18608ef
Merge pull request #288 from deveplon/add-allow-null-value-in-subset-method
Add some validation to prevent PHP Warning when value in subset is null
2019-08-15 16:36:07 +02:00
Willem Wollebrants
3acb8e23b2
Merge pull request #290 from WillRy/update-es
Adding Missing Fields for Spanish language
2019-08-15 16:33:43 +02:00
William R
3f88e776f8 Adding Missing Fields
-Added translation to missing fields
-New indentation, due to the size of the string 'containsUnique'
2019-07-03 03:55:24 -03:00
Vance Lucas
d3a0a7af11
Merge pull request #289 from WillRy/update-pt-br
Adding Missing Fields
2019-07-01 14:13:46 -05:00
William R
01f09244a7 Adding Missing Fields
-Added translation to missing fields
-New indentation, due to the size of the string 'containsUnique'
2019-06-29 19:56:17 -03:00
Diego Londono
21e9dc1263 Add some validation to prevent PHP Warning when value in subset validation is null 2019-06-27 12:01:05 -03:00
Vance Lucas
a8346868c2
Create FUNDING.yml 2019-06-26 13:13:48 -05:00
Tobias Hinz
c4ea1db371 Usage documentation adjusted 2019-05-09 16:38:39 +02:00
Tobias Hinz
0976fa3a79 Added listContains 2019-05-09 16:34:50 +02:00
Willem Wollebrants
c3b4dac858
Merge pull request #282 from vlucas/iss281
use correct typehint for callable, fix #281
2019-03-21 21:12:22 +01:00
Willem Wollebrants
7705cbc5a0
Merge pull request #280 from apapsch/master
Create arrayHasKeys validator.
2019-03-21 21:02:08 +01:00
Willem Wollebrants
dfde682d93 use correct typehint for callable 2019-03-21 21:00:30 +01:00
Aljosha Papsch
2dc2f29f7f Create arrayHasKeys validator. 2019-03-11 11:46:13 +01:00
Willem Wollebrants
c6893fc67e
Merge pull request #272 from vlucas/norwegian
move existing Norwegian (Nynorsk) to seperate file
2018-12-14 22:15:14 +01:00
Willem Wollebrants
a3eba42895 move existing Norwegian (Nynorsk) to seperate file, load this by default in no.php 2018-12-14 22:07:58 +01:00
Willem Wollebrants
3f89980dcb
Merge pull request #270 from taraldr/master
New translation Norwegian Bokmål
2018-12-14 21:49:34 +01:00
Tarald Riise
6c12b1a4c1 New translation Norwegian Bokmål 2018-12-05 14:22:54 +01:00
Willem Wollebrants
dc3314a0eb
Merge pull request #268 from dgvirtual/patch-1
Update lt.php - adding missing localized strings
2018-11-19 22:37:23 +01:00
Donatas Glodenis
6e32c1455d
Update lt.php - adding missing strings 2018-11-02 23:33:53 +02:00
Tom Breese
6f125ff666 removing gitignore for netbeans project 2018-10-15 22:42:49 -04:00
Tom Breese
ee4abd9a5f required-conditionals; fixing count to isset 2018-10-15 22:41:14 -04:00
Tom Breese
757b07f3cd required-conditionals; adding strict for requiredWithAll and requiredWithoutAll 2018-10-15 22:32:48 -04:00
Tom Breese
e3c6331380 required-conditionals; fixing field typo in readme 2018-10-14 15:32:30 -04:00
Tom Breese
c8c428b3cd required-conditionals; fixing missing semi colon in readme 2018-10-14 15:30:13 -04:00
Tom Breese
17c2f05168 required-conditionals; adding requiredwith and requiredWithout for conditional requirements 2018-10-14 15:27:37 -04:00
Willem Wollebrants
661365f317
Merge pull request #266 from mangopeaches/usage-docs
Updating readme to include examples for every type
2018-10-14 14:01:40 +02:00
Tom Breese
3f19217487 update-docs; fixing regex after mass replacing php 5.4 array with php 5.3 array 2018-10-13 13:28:03 -04:00
Tom Breese
4b60befc61 usage-docs; updating arrays to php 5.3 compatible syntax 2018-10-13 13:24:43 -04:00
Tom Breese
ac5148995e usage-docs; adding dot notation usage 2018-10-13 13:06:00 -04:00
Tom Breese
ad4ab08443 usage-docs; adding dot notation usage 2018-10-13 13:04:12 -04:00
Tom Breese
d3171b8872 Adding examples for regular and alternate syntax to docs 2018-10-13 12:57:50 -04:00
Willem Wollebrants
e3b3eb31a2
Merge pull request #222 from misantron/validators-patch
Array subset and uniqueElements validators
2018-09-23 21:46:36 +02:00
misantron
ee2ed6c3b9 Change validation rule to 'subset', document and translation fixes 2018-09-23 00:53:19 +03:00
misantron
873c996db0 Fix .gitignore: remove duplicated row 2018-09-22 17:52:25 +03:00
misantron
c52612f86c Tests code style fixes 2018-09-22 17:00:34 +03:00
misantron
f70e27af56 Merge remote master branch 2018-09-22 16:35:15 +03:00
Vance Lucas
14702f00d3
Merge pull request #261 from rauwebieten/master
ipv4, ipv6 and ascii rules
2018-09-11 11:59:23 -05:00
Willem Wollebrants
b6e9079d16
Merge pull request #263 from vlucas/iss262
Filter out non-required array parts.
2018-08-24 09:27:16 +02:00
Willem Wollebrants
aaf543517d filter out non-required array parts. Fixes #262 2018-08-22 12:54:14 +02:00
Willem Wollebrants
c5a1664dab ignore PhpStorm project settings 2018-08-22 12:53:17 +02:00
peterkinamo
46ccdf1ace ascii, ipv4 and ipv6 rules added to README.md 2018-08-03 13:38:39 +02:00
peterkinamo
e5ae2c9a5f ipv4 and ipv6 rule and tests added 2018-08-03 13:02:21 +02:00
peterkinamo
971da213a3 Ascii rule added
Ascii unit test added
2018-08-03 12:28:23 +02:00
Willem Wollebrants
3511ad84af
Merge pull request #256 from vlucas/iss255
Better PHPDoc:
fix incorrect phpdoc for callable
add phpdoc for callable where needed
2018-06-27 09:23:19 +02:00
Willem Wollebrants
fcaa1d5d52 make phpdoc more specific for parameter in Validator::addInstanceRule and Validator::addRule, both need a callable 2018-06-25 22:18:19 +02:00
Willem Wollebrants
3908f086e0 fix incorrect phpdoc for callable 2018-06-25 22:15:31 +02:00
Willem Wollebrants
3c5463315b
Merge pull request #246 from peter279k/test_enhancement
Test enhancement
2018-05-06 12:45:26 +02:00
misantron
c4be38862b Validation fixes 2018-04-20 21:00:34 +03:00
peter279k
9ec218f031 Fix count() countable error message in php7.2 2018-04-14 16:56:19 +08:00
peter279k
7c1175134d Fix include setting space 2018-04-14 16:48:59 +08:00
peter279k
631c8feb36 Use composer test in Travis build script 2018-04-14 16:44:21 +08:00
peter279k
7e735e17ea Test enhancement 2018-04-14 16:37:51 +08:00
Willem Wollebrants
4c9ea18a65
Merge pull request #244 from hided62/add-korean
Adds Korean translation
2018-04-09 09:33:49 +02:00
hide_d
802c4406b3 Fix grammatical mistakes 2018-03-30 22:39:45 +09:00
hide_d
b54a25f7a9 Added Korean 2018-03-30 22:33:10 +09:00
Willem Wollebrants
b6589e85ea
Strict integer rule
Fixed strict integer rule and added more integer unit tests
2018-03-29 20:57:51 +02:00
Willem Wollebrants
c56bf573f2
Merge pull request #241 from realjay007/stop-on-first-fail
Added option to stop validation when a rule is failed
2018-03-08 16:48:01 +01:00
misantron
48dcdc7248 Merge remote-tracking branch 'remotes/upstream/master' into validators-patch 2018-03-05 22:21:09 +03:00
Julius Ijie
4103c8bd40 Forced stopOnFirstFail parameter to bool 2018-02-23 15:59:30 +01:00
Julius Ijie
8636fed8f5 Removed boolean type declaration only available on PHP7 2018-02-23 15:55:45 +01:00
Julius Ijie
6837c9dfab Added option to stop validation when a rule is failed 2018-02-23 15:25:35 +01:00
Vance Lucas
4b32e6067a
Update composer license SPDX 2018-02-10 16:02:11 -06:00
Willem Wollebrants
013672dfce
Merge pull request #231 from piotr-cz/patch-1
Fix typo in docblock
2018-02-10 14:08:48 +01:00
Willem Wollebrants
59f04de714
Merge pull request #238 from thinkjson/master
Documentation: numeric array validation example
2018-02-10 14:08:25 +01:00
Willem Wollebrants
241c456e37
Merge pull request #239 from dgvirtual/master
Translation to Lithuanian
2018-02-10 14:07:24 +01:00
Willem Wollebrants
8abb9b7220
Merge pull request #237 from mangopeaches/nested-equals-different
added nested array support for validateEquals and validateDifferent
2018-02-07 17:35:13 +01:00
Donatas Glodenis
fb8f89a519
Translation to Lithuanian 2018-02-07 15:33:59 +00:00
Tom Breese
19a1e123bd updating tests for 5.3 compatible arrays 2018-02-06 23:10:20 -05:00
Tom Breese
32dec57f69 adding nested different both unser required test 2018-02-06 23:05:25 -05:00
Tom Breese
06d1740c32 adding tests for nulls/not set values for nested and not nested equals and different methods 2018-02-06 23:02:03 -05:00
Willem Wollebrants
ef412d1160
Merge pull request #232 from jabarihunt/improved-email-validator
Add emailDNS validator
2018-02-06 08:34:20 +01:00
Mark Cahill
fd1b55ad21 Fulfilling documentation request for numeric array validation 2018-02-05 07:15:00 -05:00
Tom Breese
7c94b2ae5a added support for nested arrays in validateEquals and validateDifferent validation methods 2018-02-04 13:24:47 -05:00
Jabari Hunt
11dc3a7850
Merge pull request #1 from willemwollebrants/improved-email-validator
Improved email validator
2018-01-31 10:30:06 -06:00
Willem Wollebrants
f8e69683af add emailDNS validator to documentation 2018-01-31 16:20:58 +01:00
Willem Wollebrants
7dcc8a5089 add test for new emailDNS validator 2018-01-31 16:19:05 +01:00
Jabari
8603b2bec3 Added idn_to_ascii() with a check to make sure the function itself exists as well as a check for a required constant that it needs to function. 2018-01-05 22:28:47 -06:00
Jabari Hunt
28ef275cde Restored the original validateEmail() method. Created a new method called validateEmailDNS() that validates both the email address itself (using the ValidateEmail() method) as well as the domain name in the email address. 2018-01-01 15:11:21 -06:00
Jabari Hunt
a49bad3ed8 Merge remote-tracking branch 'origin' into improved-email-validator 2018-01-01 14:10:49 -06:00
Willem Wollebrants
1712b04f16
Merge pull request #235 from pelmered/master
Added Swedish translation file
2017-12-20 09:03:40 +01:00
Willem Wollebrants
7804f85ea8
Merge pull request #233 from shitoudev/patch-1
Update zh-cn.php
2017-12-20 09:03:06 +01:00
Peter elmered
ac79ecd1de Added Swedish translation 2017-12-19 18:36:40 +01:00
zhenwen
c0bf6b75d8
Update zh-cn.php 2017-12-14 11:17:43 +08:00
Jabari Hunt
55154359dc Fixed a typo that was introduces in an unrelated comment. 2017-12-13 16:06:31 -06:00
Jabari Hunt
255384baa8 Made the domain check an option (via third method param). 2017-12-13 14:52:24 -06:00
Jabari Hunt
ae7716c900 Improved the email validator by making sure the domain name is valid. 2017-12-13 12:30:45 -06:00
Piotr
2438da6a99
Fix typo in docblock 2017-12-08 16:00:16 +01:00
Willem Wollebrants
42637ed954
Merge pull request #230 from vlucas/fixTest
Make testRequiredAllowEmpty() test 2 different usages
2017-12-02 21:56:17 +01:00
Willem Wollebrants
d1563d520f Make sure testRequiredAllowEmpty() tests 2 different usages for required rule 2017-12-02 21:28:13 +01:00
Vance Lucas
290113fac0
Merge pull request #225 from gabriel-caruso/phpunit
Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase
2017-11-15 10:35:54 -06:00
Gabriel Caruso
14a467ba24 Use PHPUnit\Framework\TestCase instead of PHPUnit_Framework_TestCase 2017-11-11 02:28:10 -02:00
misantron
36404a83b7 Merge branch 'master' into validators-patch 2017-11-01 23:43:09 +03:00
Willem Wollebrants
87775d7626
Merge pull request #224 from vlucas/issue223
remove unused parameter for required rule
2017-10-31 00:15:06 +01:00
Willem Wollebrants
890cf6a104 let's see if we can keep 5.3 still 2017-10-30 20:02:29 +01:00
Willem Wollebrants
3da6518e38 time to no longer test for php 5.3 2017-10-30 19:49:58 +01:00
Willem Wollebrants
9726d0f835 remove unused parameter for required rule 2017-10-30 19:44:17 +01:00
misantron
b0ddfb3a37 Merge remote-tracking branch 'origin/validators-patch' into validators-patch
# Conflicts:
#	src/Valitron/Validator.php
2017-10-26 23:11:06 +03:00
misantron
d9a466b833 Array contains and unique validators added, code style fixes 2017-10-26 23:09:45 +03:00
Dennis Meckel
eb436a382f Fixed strict integer rule and added more integer unit tests 2017-10-13 19:39:59 +02:00
Willem Wollebrants
20a9c2d604 Merge pull request #218 from vlucas/issue208
validate fields that are required, but may have empty or null values. Handles #208
2017-08-28 22:06:05 +02:00
Willem Wollebrants
9a45f79b58 Explain required-rule parameter 2017-08-28 21:59:40 +02:00
Willem Wollebrants
4cc030c68a validate fields that are required, but may have empty or null values. #208 2017-08-28 21:52:21 +02:00
Willem Wollebrants
db089ab271 Merge pull request #217 from vlucas/iss214
Remove (0-9) from default integer message #214
2017-08-28 08:50:38 +02:00
Willem Wollebrants
f35b010413 Remove (0-9) from default integer message #214 2017-08-28 08:47:45 +02:00
Willem Wollebrants
38876b96ea Merge pull request #213 from vlucas/pr210
Test for pr #212
2017-08-27 13:37:26 +02:00
Willem Wollebrants
6350cf8cb0 Test for pr #212 2017-08-27 13:34:43 +02:00
Willem Wollebrants
f49917ecfd Merge pull request #210 from jatubio/patch-1
Don't prepend field name to error message when {field} is already set in the message
2017-08-27 13:16:37 +02:00
Willem Wollebrants
4268b58e40 Merge pull request #212 from jatubio/patch-2
Update es.php
2017-08-27 13:12:00 +02:00
Juan Antonio Tubio
658b0ed5cc Update es.php
Corrected some expressions
2017-08-25 18:20:37 +02:00
Willem Wollebrants
1e98c97ca2 Merge pull request #211 from vlucas/errormsg
Make sure error messages get tested too
2017-07-18 20:57:38 +02:00
Willem Wollebrants
b29fbc50ff Make sure error messages get tested too 2017-07-18 20:54:29 +02:00
Juan Antonio Tubio
a80cbf0f3f Fixing code indentation 2017-07-18 16:46:38 +02:00
Juan Antonio Tubio
c6b2865ef6 Checking if mb_strpos() exists before use them 2017-07-18 16:44:05 +02:00
Juan Antonio Tubio
51575f3f9d Don't add {field} to message uf already exists
Fixed rule() function to don't add {field} to message if already exists on them
2017-07-18 16:18:00 +02:00
Willem Wollebrants
c3d644e1d7 Merge pull request #206 from vlucas/issue101
Always run 'accepted' validation (#101)
2017-07-06 11:27:46 +02:00
Willem Wollebrants
86cdecf193 Always run 'accepted' validation (#101) 2017-07-06 11:21:27 +02:00
Willem Wollebrants
c6c0f95129 Merge pull request #205 from vlucas/issue204
Handle malformed bulk rules (#204)
2017-07-06 11:06:28 +02:00
Willem Wollebrants
ec77d601ad Handle malformed bulk rules (#204) 2017-07-06 11:03:04 +02:00
Willem Wollebrants
107d1eebc1 Merge pull request #202 from atanasov/master
Bulgarian language
2017-06-26 23:34:20 +02:00
Atanas Atanasov
8c09f881b6 Bulgarian language 2017-06-26 14:06:11 +03:00
Willem Wollebrants
a6cf3a8c86 Merge pull request #201 from auroraeosrose/foreachbug
Check if the value in getParts is non-scalar to prevent "Invalid argument to foreach" error
2017-06-23 23:38:17 +02:00
Willem Wollebrants
1d8abc73b6 Merge pull request #200 from auroraeosrose/patch-1
Fix issue where preg_match spews when passed an array
2017-06-23 23:34:07 +02:00
Elizabeth M Smith
a7e89cf26c fix it correctly... 2017-06-23 14:41:46 -04:00
Elizabeth M Smith
66464f4c51 test for the bug 2017-06-23 14:05:47 -04:00
Elizabeth M Smith
e8ab4dc157 Fixes invalid argument to foreach
happens when you have a rule looking for sub items in arrays, but actually pass in a scalar value
bombs out with invalid argument to foreach
2017-06-23 14:01:34 -04:00
Elizabeth M Smith
4896ade387 really? 5.3 support? ewww 2017-06-23 13:50:49 -04:00
Elizabeth M Smith
05b5c40515 test for the change 2017-06-23 13:43:15 -04:00
Elizabeth M Smith
c729a0c4ac avoids php blowing up if an array value is passed
if incoming data has an array value set with a slug rule on it, you get 
preg_match() expects parameter 2 to be string, array given
vendor\vlucas\valitron\src\Valitron\Validator.php:571
2017-06-23 13:41:39 -04:00
Willem Wollebrants
15171779b3 Merge pull request #197 from adelmazza/patch-2
Update it.php
2017-05-15 09:09:53 +02:00
adelmazza
fc4e617b1a Update it.php
Added lenghtMin, lenghtMax and instanceOf to the it.php language file.
2017-05-14 16:27:01 +02:00
Willem Wollebrants
a48ead4b00 Merge pull request #192 from candrianarijaona/update-french-trad
Update french translations
2017-04-20 14:19:42 +02:00
Willem Wollebrants
67053e077f Merge pull request #190 from gustavonovaes/patch-1
Update pt-br.php
2017-04-20 14:18:53 +02:00
Claude Andrianarijaona
070823ee7b Fix typo 'and' 2017-04-08 21:02:15 +02:00
Claude Andrianarijaona
dafb5ecde1 Add some french translations 2017-04-08 20:59:12 +02:00
Gustavo Novaes
4512b69e66 Update pt-br.php
Include missing rules
2017-04-07 12:01:05 -03:00
Willem Wollebrants
b33c791162 Merge pull request #187 from notona/feature/fix-interger-validation
Add strict mode to validateInteger
2017-02-23 09:31:59 +01:00
notona
326d61f186 Merge pull request #1 from willemwollebrants/feature/fix-interger-validation
Feature/fix interger validation
2017-02-22 10:34:19 +09:00
Willem Wollebrants
1942e53a5c Remove unneeded test testIntegerWithMaxValidation 2017-02-21 21:12:27 +01:00
Willem Wollebrants
28d954817b Use an optional parameter to make validateInteger more strict 2017-02-21 21:11:14 +01:00
notona
cb1ecb12e6 fix for test codes 2017-02-20 12:32:37 +09:00
notona
bc035a4a95 add more tests 2017-02-20 12:28:16 +09:00
notona
7c990e39ef fix integer validation process 2017-02-20 12:18:18 +09:00
Willem Wollebrants
971501551c Merge pull request #185 from AchoArnold/patch-1
Makes the data parameter optional in the constructor
2017-02-14 16:36:59 +01:00
Acho Arnold
f698be0c95 Makes the data parameter optional in the constructor
This Fixes #184
2017-02-14 16:30:25 +01:00
Willem Wollebrants
79de211bdf Merge pull request #183 from vlucas/mapFieldRules
Map field rules
2017-02-09 20:49:39 +01:00
Willem Wollebrants
80457c510c mapFieldRules documentation 2017-02-09 20:46:08 +01:00
Willem Wollebrants
c8895683f7 mapFieldRules 2017-02-09 20:39:17 +01:00
Willem Wollebrants
43c97db077 Add .gitattributes 2017-02-09 16:09:41 +01:00
Willem Wollebrants
37408859b8 Merge pull request #178 from mprince/boolean
Add boolean rule to README & remove unnecessary ternary
2017-01-25 09:11:44 +01:00
Marcel Prince
a09ac827c6 Add boolean rule to README & remove unnecessary ternary 2017-01-24 16:07:48 -08:00
Willem Wollebrants
a38c9b8fce Merge pull request #176 from delef/patch-1
Fix incorrect return type in phpDOC for Validator::withData
2017-01-16 14:35:28 +01:00
Ivan Palamarchuk
b0c188d430 Fix incorrect IDE work 2017-01-16 16:24:57 +03:00
Willem Wollebrants
13d4374de5 Merge pull request #175 from marknl/patch-2
Dutch messages: some tweaks
2017-01-02 20:44:00 +01:00
Marknl
dc17891def Some tweaks
There were some inconsistent translations.
2017-01-02 13:02:38 +01:00
misantron
ccc6df8ba0 Merge branch 'master' into validators-patch
Conflicts:
	src/Valitron/Validator.php
2016-12-26 16:31:14 +03:00
misantron
11139b8534 Code style changes and fixes 2016-12-26 16:28:59 +03:00
Willem Wollebrants
28d5a5a0a3 Merge pull request #173 from EgorGruzdev/master
Fix doctype declaration for rule method. Allows both array and string for $field parameter
2016-12-14 09:47:35 +01:00
Egor Gruzdev
5181664c79 for PhpStorm validation 2016-12-14 10:40:14 +02:00
Willem Wollebrants
d9b1548c39 Merge pull request #171 from vlucas/withDataBugfix
With data bugfix
2016-12-09 11:59:35 +01:00
Willem Wollebrants
768a26c7f4 Add note about re-usability to readme 2016-12-09 11:50:13 +01:00
Willem Wollebrants
f8290a8c59 Fix bug where Validator::withData would also erase all rules 2016-12-09 11:44:39 +01:00
Vance Lucas
399004d172 Merge pull request #169 from andysnell/update-mastercard-bin-range
Update MasterCard BIN Range
2016-12-06 10:04:05 -06:00
Andy Snell
f9dd486b5d
Update MasterCard BIN Range
Updates the credit card validator regular expression for the MasterCard brand to also match 16-digit card numbers starting with 22 - 27.  Additionally, updates the unit test for credit cards with two published test cards in the new BIN range.

Additional information on the BIN range update can be found at: https://www.mastercard.us/en-us/issuers/get-support/2-series-bin-expansion.html
2016-12-05 00:09:39 -05:00
Willem Wollebrants
ce8e9a4a39 Merge pull request #167 from shin1x1/fix-wrong-return-type
Fix wrong @return in Doc Comments
2016-11-15 13:32:32 +01:00
shin1x1
4f0f78ecfb Fix wrong @return 2016-11-15 18:06:16 +09:00
Willem Wollebrants
633c9ff57f Merge pull request #166 from Matt3o12/addTmpRule
Add anonymous and instance rules
2016-11-13 13:13:10 +01:00
Matteo Kloiber
a6be7e2dd0 Validator::rule now accepts any kind of callback
This has been achieved by making sure that the rule is neither
a "native" Validator rule (e.g. there is a validate{$CamleCaseName}
method) nor it has been registered.

If both conditions are met, the rule (even if it is a string)
will be accepted and used.

Tests for this case have also been added.
2016-11-06 01:46:35 +01:00
Matteo Kloiber
ebbeca46af Updated README.md 2016-11-06 01:46:34 +01:00
Matteo Kloiber
74a882969e Indent fixed 2016-11-06 01:46:28 +01:00
Matteo Kloiber
7a5fd66990 Validator::rule now supports closures
Validator::rule now allows the rule to be a closure.
This allows us to add an anonymous rule that is only
valid for the specified field(s):

$someObject = new MyObject();
$v->rule(function($field, $value) use ($someObject)
    return $value === $someObject->someState();
}, ["shared_secret", "other"])
    ->label("invalid state!");

This is especially useful if you have either a) have
a rule which you are not likely to be reusing or b)
you need access to some object which cannot be easily
connstructed (because it requires IO access, etc).

Either way, this is really only convenience method
because it saves you a call to Validator::addInstanceRule.

Internally, it does exactly that: it 1) determines a valid
rule name, 2) calls addInstanceRule() with the name
determined in 1) and the Closure, and then 3) replaces
the $rule parameter (which is the Closure object) by
the name of the rule.

1) is determined like this: if multiple parameters were
given, they are joined together into one string glued
with a underscore. '_rule' is then appended so that
the name becomes all_params_rule. If the name is already
used by any other rule, it will append up to 5
pseudo-random digits to the rule. In the unlikely event
that this rule is also used, step 1) will be repeated
until a unique rule name is found.
2016-11-06 01:46:25 +01:00
Matteo Kloiber
df78fe188c Added support for instance rules
Instance rules are not shared among other validator
objects (thus they are not static). This is useful
if you have a rule you do not want your other validators
to use (because it is very special to this validator).

The parameter given to addInstanceRule is identically to
addRule:

    public function addInstanceRule(string $name, callable $callback [, string message])

Instead of appending to the static variables $_rules, and
$_ruleMessages, it now appends to $_instanceRules and
$_instanceRuleMessages.

A new getter for the rules and ruleMessage has also been added:

    public array getRules()
    public array getRuleMessages()

All existing code has been updated to use getRules(), and
getRuleMessages() instead of $_rules, and $_ruleMessages.
2016-11-06 01:46:17 +01:00
Willem Wollebrants
6200b45304 Merge pull request #161 from vlucas/withdata
Added withData method for immutable reusability
2016-08-17 21:48:04 +02:00
Willem Wollebrants
94317636d9 Added withData method for immutable reusability 2016-08-17 21:44:17 +02:00
Willem Wollebrants
fc6f5c138e Update en.php
add a verb to the lengthMin error
2016-07-31 11:57:12 +02:00
Willem Wollebrants
0c9feabe0e Merge pull request #160 from HelgeSverre/master
Added norwegian language file
2016-07-24 11:41:07 +02:00
Helge Sverre
a9169771ef Added norwegian language file 2016-07-24 11:23:39 +02:00
Vance Lucas
86e64c1cd9 Merge pull request #158 from static-m/master
Added Slovak language.
2016-06-29 09:15:02 -05:00
Martin Gazdag [office]
d3660fd6f1 Added Slovak language. 2016-06-29 15:32:56 +02:00
Willem Wollebrants
e55681c9ab Merge pull request #155 from misantron/validators-patch
Contains and between validators
2016-05-22 14:02:59 +02:00
misantron
d47c6206ed Change contains validator default mode to strict 2016-05-21 20:48:01 +03:00
misantron
a89c0972c1 Contains validator update, between validator added 2016-03-26 00:55:08 +03:00
Willem Wollebrants
7ba25fe5af Merge pull request #153 from misantron/develop
English and Russian translations update
2016-03-25 15:48:11 +01:00
misantron
69be152f3a English and russian translations fix 2016-03-24 22:08:52 +03:00
52 changed files with 4745 additions and 504 deletions

5
.gitattributes vendored Normal file
View File

@ -0,0 +1,5 @@
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml export-ignore

1
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1 @@
tidelift: "packagist/vlucas/valitron"

73
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,73 @@
name: Run Tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.operating-system }}
strategy:
matrix:
operating-system: ['ubuntu-latest']
php-versions:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'
- '7.2'
- '7.3'
- '7.4'
- '8.0'
# - '8.1'
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-versions }}
- name: Cache composer packages
id: composer-cache
uses: actions/cache@v2
with:
path: vendor
key: ${{ runner.os }}-php-${{ matrix.php-versions }}-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-${{ matrix.php-versions }}-
- name: Validate composer configuration
run: |
composer validate
- name: Install dependencies
run: |
composer install --no-progress
- name: Run tests
run: |
composer run-script test
# test-hhvm:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Setup HHVM
# uses: azjezz/setup-hhvm@v1
# with:
# version: latest
# debug: false
# - name: Cache composer packages
# id: composer-cache
# uses: actions/cache@v2
# with:
# path: vendor
# key: ${{ runner.os }}-hhvm-${{ hashFiles('**/composer.lock') }}
# restore-keys: |
# ${{ runner.os }}-hhvm-
# - name: Validate composer configuration
# run: |
# composer validate
# - name: Install dependencies
# run: |
# composer install --no-progress
# - name: Run tests
# run: |
# composer run-script test

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
composer.phar composer.phar
composer.lock composer.lock
vendor vendor
.idea/
.phpunit.result.cache

View File

@ -1,20 +0,0 @@
# see http://about.travis-ci.org/docs/user/languages/php/ for more hints
language: php
# list any PHP version you want to test against
php:
- 5.3
- 5.4
- 5.5
- 5.6
- hhvm
matrix:
allow_failures:
- php: hhvm
before_script:
- composer install
# Script to run tests
script: ./vendor/bin/phpunit

1051
README.md

File diff suppressed because it is too large Load Diff

View File

@ -3,24 +3,32 @@
"type": "library", "type": "library",
"description": "Simple, elegant, stand-alone validation library with NO dependencies", "description": "Simple, elegant, stand-alone validation library with NO dependencies",
"keywords": ["validation", "validator", "valid"], "keywords": ["validation", "validator", "valid"],
"homepage": "http://github.com/vlucas/valitron", "homepage": "https://github.com/vlucas/valitron",
"license" : "BSD", "license": "BSD-3-Clause",
"authors" : [ "authors": [
{ {
"name": "Vance Lucas", "name": "Vance Lucas",
"email": "vance@vancelucas.com", "email": "vance@vancelucas.com",
"homepage": "http://www.vancelucas.com" "homepage": "https://www.vancelucas.com"
} }
], ],
"require": { "require": {
"php": ">=5.3.2" "php": ">=5.3.2"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "~4.0" "phpunit/phpunit": ">=4.8.35"
},
"suggest": {
"ext-mbstring": "It can support the multiple bytes string length."
}, },
"autoload": { "autoload": {
"psr-0": { "psr-4": {
"Valitron": "src/" "Valitron\\": "src/Valitron"
}
},
"autoload-dev": {
"psr-4": {
"Valitron\\": "tests/Valitron"
} }
}, },
"scripts": { "scripts": {

View File

@ -11,6 +11,7 @@ return array(
'min' => "يجب ان يكون اعلي من %s", 'min' => "يجب ان يكون اعلي من %s",
'max' => "يجب ان يكون اقل من %s", 'max' => "يجب ان يكون اقل من %s",
'in' => "الُمدخل يغير صحيح", 'in' => "الُمدخل يغير صحيح",
'listContains' => "الُمدخل يغير صحيح",
'notIn' => "الُمدخل يغير صحيح", 'notIn' => "الُمدخل يغير صحيح",
'ip' => "رقم الإتصال غير صحيح", 'ip' => "رقم الإتصال غير صحيح",
'email' => "البريد الألكتروني غير صحيح", 'email' => "البريد الألكتروني غير صحيح",

View File

@ -10,6 +10,7 @@ return array(
'length' => "%d qədər uzunluğu olmalıdır", 'length' => "%d qədər uzunluğu olmalıdır",
'min' => "minimum %s qədər olmalıdır", 'min' => "minimum %s qədər olmalıdır",
'max' => "maksimum %s qədər olmalıdır", 'max' => "maksimum %s qədər olmalıdır",
'listContains' => "yalnış dəyər ehtiva edir",
'in' => "yalnış dəyər ehtiva edir", 'in' => "yalnış dəyər ehtiva edir",
'notIn' => "yalnış dəyər ehtiva edir", 'notIn' => "yalnış dəyər ehtiva edir",
'ip' => "düzgün IP ünvanı deyil", 'ip' => "düzgün IP ünvanı deyil",

35
lang/bg.php Normal file
View File

@ -0,0 +1,35 @@
<?php
return array(
'required' => "е задължително",
'equals' => "трябва да бъде същото като '%s'",
'different' => "трябва да бъде различно от '%s'",
'accepted' => "трабва да бъде прието",
'numeric' => "трябва да бъде число",
'integer' => "трябва да бъде цифра (0-9)",
'length' => "трябва да бъде %d символа дълго",
'min' => "трябвя да бъде поне %s",
'max' => "трябва да бъде не повече от %s",
'listContains' => "съдържа невалидна стойност",
'in' => "съдържа невалидна стойност",
'notIn' => "съдържа невалидна стойност",
'ip' => "е невалиден IP адрес",
'email' => "е невалиден имейл адрес",
'url' => "е невалиден URL адрес",
'urlActive' => "трябва да бъде активен домейн",
'alpha' => "трябва да съдържа само букви a-z",
'alphaNum' => "трябва да съдържа само букви a-z и/или цифри 0-9",
'slug' => "трябва да съдържа само букви a-z, цифри 0-9, тирета и долни черти",
'regex' => "съдържа невалидни символи",
'date' => "е невалидна дата",
'dateFormat' => "трябва да бъде дата с формат '%s'",
'dateBefore' => "трябва да бъде дата преди '%s'",
'dateAfter' => "трябва да бъде дата след '%s'",
'contains' => "трябв да съдържа %s",
'boolean' => "трябва да бъде истина или лъжа",
'lengthBetween' => "трябва да бъде между %d и %d символа",
'creditCard' => "трябва да бъде валиден номер на кредитна карта",
'lengthMin' => "трябва да бъде поне %d символа дълго",
'lengthMax' => "не трябва да надвишава %d символа",
'instanceOf' => "трябва да бъде инстанция от '%s'"
);

View File

@ -10,6 +10,7 @@ return array(
'length' => "kann nicht länger als %d sein", 'length' => "kann nicht länger als %d sein",
'min' => "muss größer als %s sein", 'min' => "muss größer als %s sein",
'max' => "muss kleiner als %s sein", 'max' => "muss kleiner als %s sein",
'listContains' => "enthält einen ungültigen Wert",
'in' => "enthält einen ungültigen Wert", 'in' => "enthält einen ungültigen Wert",
'notIn' => "enthält einen ungültigen Wert", 'notIn' => "enthält einen ungültigen Wert",
'ip' => "enthält keine gültige IP-Addresse", 'ip' => "enthält keine gültige IP-Addresse",

View File

@ -6,10 +6,11 @@ return array(
'different' => "πρέπει να διαφέρει από '%s'", 'different' => "πρέπει να διαφέρει από '%s'",
'accepted' => "πρέπει να έχει αποδεχτεί", 'accepted' => "πρέπει να έχει αποδεχτεί",
'numeric' => "πρέπει να είναι αριθμός", 'numeric' => "πρέπει να είναι αριθμός",
'integer' => "πρέπει να είναι ακέραιος αριθμός (0-9)", 'integer' => "πρέπει να είναι ακέραιος αριθμός",
'length' => "πρέπει να είναι μεγαλύτερο από %d", 'length' => "πρέπει να είναι μεγαλύτερο από %d",
'min' => "πρέπει να είναι τουλάχιστον %s", 'min' => "πρέπει να είναι τουλάχιστον %s",
'max' => "δεν πρέπει να είναι περισσότερο από %s", 'max' => "δεν πρέπει να είναι περισσότερο από %s",
'listContains' => "περιέχει μη έγκυρη τιμή",
'in' => "περιέχει μη έγκυρη τιμή", 'in' => "περιέχει μη έγκυρη τιμή",
'notIn' => "περιέχει μη έγκυρη τιμή", 'notIn' => "περιέχει μη έγκυρη τιμή",
'ip' => "δεν είναι έγκυρη διεύθυνση IP", 'ip' => "δεν είναι έγκυρη διεύθυνση IP",

View File

@ -1,34 +1,42 @@
<?php <?php
return array( return array(
'required' => "is required", 'required' => "is required",
'equals' => "must be the same as '%s'", 'equals' => "must be the same as '%s'",
'different' => "must be different than '%s'", 'different' => "must be different than '%s'",
'accepted' => "must be accepted", 'accepted' => "must be accepted",
'numeric' => "must be numeric", 'numeric' => "must be numeric",
'integer' => "must be an integer (0-9)", 'integer' => "must be an integer",
'length' => "must be at least %d long", 'length' => "must be %d characters long",
'min' => "must be at least %s", 'min' => "must be at least %s",
'max' => "must be no more than %s", 'max' => "must be no more than %s",
'in' => "contains invalid value", 'listContains' => "contains invalid value",
'notIn' => "contains invalid value", 'in' => "contains invalid value",
'ip' => "is not a valid IP address", 'notIn' => "contains invalid value",
'email' => "is not a valid email address", 'ip' => "is not a valid IP address",
'url' => "not a URL", 'ipv4' => "is not a valid IPv4 address",
'urlActive' => "must be an active domain", 'ipv6' => "is not a valid IPv6 address",
'alpha' => "must contain only letters a-z", 'email' => "is not a valid email address",
'alphaNum' => "must contain only letters a-z and/or numbers 0-9", 'url' => "is not a valid URL",
'slug' => "must contain only letters a-z, numbers 0-9, dashes and underscores", 'urlActive' => "must be an active domain",
'regex' => "contains invalid characters", 'alpha' => "must contain only letters a-z",
'date' => "is not a valid date", 'alphaNum' => "must contain only letters a-z and/or numbers 0-9",
'dateFormat' => "must be date with format '%s'", 'slug' => "must contain only letters a-z, numbers 0-9, dashes and underscores",
'dateBefore' => "must be date before '%s'", 'regex' => "contains invalid characters",
'dateAfter' => "must be date after '%s'", 'date' => "is not a valid date",
'contains' => "must contain %s", 'dateFormat' => "must be date with format '%s'",
'boolean' => "must be a boolean", 'dateBefore' => "must be date before '%s'",
'lengthBetween' => "must be between %d and %d characters", 'dateAfter' => "must be date after '%s'",
'creditCard' => "must be a valid credit card number", 'contains' => "must contain %s",
"lengthMin" => "must contain greater than %d characters", 'boolean' => "must be a boolean",
"lengthMax" => "must contain less than %d characters", 'lengthBetween' => "must be between %d and %d characters",
"instanceOf" => "must be an instance of '%s'" 'creditCard' => "must be a valid credit card number",
'lengthMin' => "must be at least %d characters long",
'lengthMax' => "must not exceed %d characters",
'instanceOf' => "must be an instance of '%s'",
'containsUnique' => "must contain unique elements only",
'requiredWith' => "is required",
'requiredWithout'=> "is required",
'subset' => "contains an item that is not in the list",
'arrayHasKeys' => "does not contain all required keys",
); );

View File

@ -1,34 +1,37 @@
<?php <?php
return array( return array(
'required' => "es requerido", 'required' => "es obligatorio",
'equals' => "debe ser igual a '%s'", 'equals' => "debe ser igual a '%s'",
'different' => "debe ser diferente a '%s'", 'different' => "debe ser diferente a '%s'",
'accepted' => "debe ser aceptado", 'accepted' => "debe ser aceptado",
'numeric' => "debe ser numérico", 'numeric' => "debe ser numérico",
'integer' => "debe ser un entero (0-9)", 'integer' => "debe ser un entero",
'length' => "debe ser mas largo de %d", 'length' => "debe ser mas largo de %d",
'min' => "debe ser mayor a %s", 'min' => "debe ser mayor de %s",
'max' => "debe ser menor a %s", 'max' => "debe ser menor de %s",
'in' => "contiene un valor invalido", 'in' => "contiene un valor inválido",
'notIn' => "contiene un valor invalido", 'notIn' => "contiene un valor inválido",
'ip' => "no es una dirección IP", 'ip' => "no es una dirección IP",
'email' => "no es un correo electrónico válido", 'email' => "no es un correo electrónico válido",
'url' => "no es una URL", 'url' => "no es una URL",
'urlActive' => "debe ser un dominio activo", 'urlActive' => "debe ser un dominio activo",
'alpha' => "debe contener solo letras a-z", 'alpha' => "debe contener solo letras a-z",
'alphaNum' => "debe contener solo letras a-z o números 0-9", 'alphaNum' => "debe contener solo letras a-z o números 0-9",
'slug' => "debe contener solo letras a-z, números 0-9, diagonales y guiones bajos", 'slug' => "debe contener solo letras a-z, números 0-9, barras y guiones bajos",
'regex' => "contiene caracteres inválidos", 'regex' => "contiene caracteres inválidos",
'date' => "no es una fecha válida", 'date' => "no es una fecha válida",
'dateFormat' => "debe ser una fecha con formato '%s'", 'dateFormat' => "debe ser una fecha con formato '%s'",
'dateBefore' => "debe ser una fecha antes de '%s'", 'dateBefore' => "debe ser una fecha antes de '%s'",
'dateAfter' => "debe ser una fecha después de '%s'", 'dateAfter' => "debe ser una fecha después de '%s'",
'contains' => "debe contener %s", 'contains' => "debe contener %s",
'boolean' => "debe ser booleano", 'boolean' => "debe ser booleano",
'lengthBetween' => "debe ser entre %d y %d caracteres", 'lengthBetween' => "debe tener entre %d y %d caracteres",
'creditCard' => "debe ser un numero de tarjeta de crédito válido", 'creditCard' => "debe ser un numero de tarjeta de crédito válido",
"lengthMin" => "debe contener mas de %d caracteres", "lengthMin" => "debe tener al menos %d caracteres",
"lengthMax" => "debe contener menos de %d caracteres", "lengthMax" => "debe tener menos de %d caracteres",
"instanceOf" => "debe ser una instancia de '%s'" "instanceOf" => "debe ser una instancia de '%s'",
'containsUnique' => "debe contener solo valores únicos",
'subset' => "contiene un elemento que no está en la lista",
'arrayHasKeys' => "no contiene todas las claves requeridas"
); );

42
lang/fa.php Normal file
View File

@ -0,0 +1,42 @@
<?php
return array(
'required' => "الزامی است",
'equals' => " باید برابر باشد با '%s'",
'different' => "باید متفاوت باشد از '%s'",
'accepted' => "باید پذیرفته شده باشد",
'numeric' => "باید مقدار عددی باشد",
'integer' => "باید عددی طبیعی باشد",
'length' => "طول باید %d باشد",
'min' => "حداقل باید %s کاراکتر باشد",
'max' => "نباید بیشتر از %s کارکتر باشد",
'listContains' => "حاوی مقدار نامعتبر",
'in' => "حاوی مقدار نامعتبر",
'notIn' => "حاوی مقدار نامعتبر",
'ip' => " آدرس معتبر نیست IP",
'ipv4' => "آدرس معتبر نیست IPv4",
'ipv6' => "آدرس معتبر نیست IPv6",
'email' => "آدرس ایمیل معتبر نیست",
'url' => "معتبر نیست URL",
'urlActive' => "دامنه باید فعال باشد",
'alpha' => "باید حاوی حروف a-z باشد",
'alphaNum' => "باید حاوی حروف a-z و/یا اعداد 0-9 باشد",
'slug' => "باید حاوی حروف a-z, اعداد 0-9, دش و آندراسکور باشد",
'regex' => "حاوی کارکترهای نامعتبر",
'date' => "تاریخ معتبر نیست",
'dateFormat' => "فرمت تاریخ باید به این شکل '%s' باشد",
'dateBefore' => "تاریخ باید قبل از '%s' باشد",
'dateAfter' => "تاریخ باید بعد از '%s' باشد",
'contains' => "باید حاوی %s باشد",
'boolean' => "مقدار باید بولین باشد",
'lengthBetween' => "طول باید بین %d و %d کاراکتر باشد",
'creditCard' => "شماره کارت اعتباری معتبر نیست",
'lengthMin' => "طول باید حداقل %d کاراکتر باشد",
'lengthMax' => "طول نباید بیشتر از %d کاراکتر باشد",
'instanceOf' => "باید آبجکتی از نوع '%s' باشد",
'containsUnique' => "باید حاوی المان ها یونیک باشد",
'requiredWith' => "الزامی است",
'requiredWithout'=> "الزامی است",
'subset' => "حاوی آیتمی است که در لیست موجود نیست",
'arrayHasKeys' => "همه کلیدهای الزامی را ندارد",
);

View File

@ -6,10 +6,11 @@ return array(
'different' => "on sama kuin '%s'", 'different' => "on sama kuin '%s'",
'accepted' => "ei ole hyväksytty", 'accepted' => "ei ole hyväksytty",
'numeric' => "ei ole numeerinen", 'numeric' => "ei ole numeerinen",
'integer' => "ei ole kokonaisluku (0-9)", 'integer' => "ei ole kokonaisluku",
'length' => "on lyhyempi kuin %d", 'length' => "on lyhyempi kuin %d",
'min' => "ei ole vähintään %s", 'min' => "ei ole vähintään %s",
'max' => "ei ole enintään %s", 'max' => "ei ole enintään %s",
'listContains' => "sisältää virheellisen arvon",
'in' => "sisältää virheellisen arvon", 'in' => "sisältää virheellisen arvon",
'notIn' => "sisältää virheellisen arvon", 'notIn' => "sisältää virheellisen arvon",
'ip' => "ei ole oikeanmuotoinen IP-osoite", 'ip' => "ei ole oikeanmuotoinen IP-osoite",

View File

@ -1,29 +1,40 @@
<?php <?php
return array( return array(
'required' => "est obligatoire", 'required' => "est obligatoire",
'equals' => "doit être identique à '%s'", 'equals' => "doit être identique à '%s'",
'different' => "doit être différent de '%s'", 'different' => "doit être différent de '%s'",
'accepted' => "doit être accepté", 'accepted' => "doit être accepté",
'numeric' => "doit être numérique", 'numeric' => "doit être numérique",
'integer' => "doit être un entier (0-9)", 'integer' => "doit être un entier",
'length' => "doit être plus long que %d", 'length' => "doit être plus long que %d",
'min' => "doit être plus grand que %s", 'min' => "doit être plus grand que %s",
'max' => "doit être plus petit que %s", 'max' => "doit être plus petit que %s",
'in' => "contient une valeur non valide", 'listContains' => "contient une valeur non valide",
'notIn' => "contient une valeur non valide", 'in' => "contient une valeur non valide",
'ip' => "n'est pas une adresse IP valide", 'notIn' => "contient une valeur non valide",
'email' => "n'est pas une adresse email valide", 'ip' => "n'est pas une adresse IP valide",
'url' => "n'est pas une URL", 'email' => "n'est pas une adresse email valide",
'urlActive' => "doit être un domaine actif", 'url' => "n'est pas une URL",
'alpha' => "doit contenir uniquement les lettres a-z", 'urlActive' => "doit être un domaine actif",
'alphaNum' => "doit contenir uniquement des lettres de a-z et/ou des chiffres 0-9", 'alpha' => "doit contenir uniquement les lettres a-z",
'slug' => "doit contenir uniquement des lettres de a-z, des chiffres 0-9, des tirets et des traits soulignés", 'alphaNum' => "doit contenir uniquement des lettres de a-z et/ou des chiffres 0-9",
'regex' => "contient des caractères invalides", 'slug' => "doit contenir uniquement des lettres de a-z, des chiffres 0-9, des tirets et des traits soulignés",
'date' => "n'est pas une date valide", 'regex' => "contient des caractères invalides",
'dateFormat' => "doit être une date avec le format '%s'", 'date' => "n'est pas une date valide",
'dateBefore' => "doit être une date avant '%s'", 'dateFormat' => "doit être une date avec le format '%s'",
'dateAfter' => "doit être une date après '%s'", 'dateBefore' => "doit être une date avant '%s'",
'contains' => "doit contenir %s", 'dateAfter' => "doit être une date après '%s'",
'boolean' => "doit être un booléen", 'contains' => "doit contenir %s",
'boolean' => "doit être un booléen",
'lengthBetween' => "doit être entre %d et %d caractères",
'creditCard' => "doit être un numéro de carte de crédit valide",
'lengthMin' => "doit avoir au moins %d caractères",
'lengthMax' => "ne doit pas dépasser %d caractères",
'instanceOf' => "doit être une instance de '%s'",
"containsUnique" => "doit contenir des élements unique",
"requiredWith" => "est requis",
"requiredWithout" => "est requis",
"subset" => "contient un élement qui n'est pas dans la liste",
"arrayHasKeys" => "ne contient pas toutes les clés requises"
); );

View File

@ -6,10 +6,11 @@ return array(
'different' => "harus berbeda dengan '%s'", 'different' => "harus berbeda dengan '%s'",
'accepted' => "harus diterima (accepted)", 'accepted' => "harus diterima (accepted)",
'numeric' => "harus berupa nomor/angka", 'numeric' => "harus berupa nomor/angka",
'integer' => "harus berupa nilai integer (0-9)", 'integer' => "harus berupa nilai integer",
'length' => "harus lebih panjang dari %d", 'length' => "harus lebih panjang dari %d",
'min' => "harus lebih besar dari %s", 'min' => "harus lebih besar dari %s",
'max' => "harus kurang dari %s", 'max' => "harus kurang dari %s",
'listContains' => "berisi nilai/value yang tidak valid",
'in' => "berisi nilai/value yang tidak valid", 'in' => "berisi nilai/value yang tidak valid",
'notIn' => "berisi nilai/value yang tidak valid", 'notIn' => "berisi nilai/value yang tidak valid",
'ip' => "format alamat IP tidak benar", 'ip' => "format alamat IP tidak benar",

View File

@ -6,10 +6,11 @@ return array(
'different' => "deve essere differente da '%s'", 'different' => "deve essere differente da '%s'",
'accepted' => "deve essere accettato", 'accepted' => "deve essere accettato",
'numeric' => "deve essere numerico", 'numeric' => "deve essere numerico",
'integer' => "deve essere un intero (0-9)", 'integer' => "deve essere un intero",
'length' => "deve avere una lunghezza di %d", 'length' => "deve avere una lunghezza di %d",
'min' => "deve essere superiore a %s", 'min' => "deve essere superiore a %s",
'max' => "deve essere inferiore a %s", 'max' => "deve essere inferiore a %s",
'listContains' => "contiene un valore non valido",
'in' => "contiene un valore non valido", 'in' => "contiene un valore non valido",
'notIn' => "contiene un valore non valido", 'notIn' => "contiene un valore non valido",
'ip' => "non è un indirizzo IP valido", 'ip' => "non è un indirizzo IP valido",
@ -27,5 +28,8 @@ return array(
'contains' => "deve contenere %s", 'contains' => "deve contenere %s",
'boolean' => "deve essere un booleano", 'boolean' => "deve essere un booleano",
'lengthBetween' => "deve essere compreso tra %d e %d caratteri", 'lengthBetween' => "deve essere compreso tra %d e %d caratteri",
'creditCard' => "deve essere un numero di carta di credito valido" 'creditCard' => "deve essere un numero di carta di credito valido",
'lengthMin' => "deve essere lungo almeno %d caratteri",
'lengthMax' => "non deve superare %d caratteri",
'instanceOf' => "deve essere un'istanza di '%s'",
); );

View File

@ -1,34 +1,42 @@
<?php <?php
return array( return array(
'required' => "を入力してください", 'required' => "を入力してください",
'equals' => "は「%s」と同じ内容を入力してください", 'equals' => "は「%s」と同じ内容を入力してください",
'different' => "は「%s」と異なる内容を入力してください", 'different' => "は「%s」と異なる内容を入力してください",
'accepted' => "に同意してください", 'accepted' => "に同意してください",
'numeric' => "は数値を入力してください", 'numeric' => "は数値を入力してください",
'integer' => "は半角数字で入力してください", 'integer' => "は半角数字で入力してください",
'length' => "は%d文字で入力してください", 'length' => "は%d文字で入力してください",
'min' => "には%sより大きな値を入力してください", 'min' => "には%sより大きな値を入力してください",
'max' => "には%sより小さな値を入力してください", 'max' => "には%sより小さな値を入力してください",
'in' => "には選択できない値が含まれています", 'listContains' => "には選択できない値が含まれています",
'notIn' => "には選択できない値が含まれています", 'in' => "には選択できない値が含まれています",
'ip' => "はIPアドレスの書式として正しくありません", 'notIn' => "には選択できない値が含まれています",
'email' => "はメールアドレスの書式として正しくありません", 'ip' => "はIPアドレスの書式として正しくありません",
'url' => "はURLの書式として正しくありません", 'ipv4' => "はIPv4のIPアドレスの書式として正しくありません",
'urlActive' => "はアクティブなドメインではありません", 'ipv6' => "はIPv6のIPアドレスの書式として正しくありません",
'alpha' => "は半角英字で入力してください", 'email' => "はメールアドレスの書式として正しくありません",
'alphaNum' => "は半角英数字で入力してください", 'url' => "はURLの書式として正しくありません",
'slug' => "は半角英数字、もしくは「-」「_」の文字で入力してください", 'urlActive' => "はアクティブなドメインではありません",
'regex' => "の書式が正しくありません", 'alpha' => "は半角英字で入力してください",
'date' => "は日付の書式として正しくありません", 'alphaNum' => "は半角英数字で入力してください",
'dateFormat' => "は「%s」の書式で日付を入力してください", 'slug' => "は半角英数字、もしくは「-」「_」の文字で入力してください",
'dateBefore' => "は「%s」以前の日付を入力してください", 'regex' => "の書式が正しくありません",
'dateAfter' => "は「%s」以後の日付を入力してください", 'date' => "は日付の書式として正しくありません",
'contains' => "は「%s」を含んでいなければいけません", 'dateFormat' => "は「%s」の書式で日付を入力してください",
'boolean' => "は真偽値である必要があります", 'dateBefore' => "は「%s」以前の日付を入力してください",
'lengthBetween' => "は%d〜%d文字で入力してください", 'dateAfter' => "は「%s」以後の日付を入力してください",
'creditCard' => "はクレジットカード番号の書式として正しくありません", 'contains' => "は「%s」を含んでいなければいけません",
'lengthMin' => "は%d文字以上入力してください", 'boolean' => "は真偽値である必要があります",
'lengthMax' => "は%d文字以内で入力してください", 'lengthBetween' => "は%d〜%d文字で入力してください",
'instanceOf' => "は「%s」のインスタンスではありません", 'creditCard' => "はクレジットカード番号の書式として正しくありません",
'lengthMin' => "は%d文字以上入力してください",
'lengthMax' => "は%d文字以内で入力してください",
'instanceOf' => "は「%s」のインスタンスではありません",
'containsUnique' => "は重複のないように入力してください",
'requiredWith' => "を入力してください",
'requiredWithout' => "を入力してください",
'subset' => "には選択できない値が含まれています",
'arrayHasKeys' => "の必要な項目が選択されていません",
); );

35
lang/ko.php Normal file
View File

@ -0,0 +1,35 @@
<?php
return array(
'required' => "을(를) 입력해야 합니다.",
'equals' => "은(는) '%s'와(과) 같아야 합니다.",
'different' => "은(는) '%s'와(과) 달라야 합니다.",
'accepted' => "을(를) 동의해야 합니다.",
'numeric' => "은(는) 숫자여야 합니다.",
'integer' => "은(는) 정수여야 합니다.",
'length' => "의 길이는 %d 이어야 합니다.",
'min' => "은(는) %s 이상이어야 합니다.",
'max' => "은(는) %s 이하여야 합니다.",
'listContains' => "은(는) 올바르지 않은 값을 포함하고 있습니다.",
'in' => "은(는) 올바르지 않은 값을 포함하고 있습니다.",
'notIn' => "은(는) 올바르지 않은 값을 포함하고 있습니다.",
'ip' => "은(는) 올바르지 않은 IP입니다.",
'email' => "은(는) 올바르지 않은 email입니다.",
'url' => "은(는) 올바르지 않은 URL입니다.",
'urlActive' => "은(는) 접속 가능한 도메인이어야 합니다.",
'alpha' => "은(는) 영문자(a-z)로만 이루어져야 합니다.",
'alphaNum' => "은(는) 영문자(a-z)와 숫자(0-9)로만 이루어져야 합니다.",
'slug' => "은(는) 영문자(a-z)와 숫자(0-9), 특수문자 -와 _로만 이루어져야 합니다.",
'regex' => "은(는) 올바르지 않은 문자를 포함하고 있습니다.",
'date' => "은(는) 올바르지 않은 날짜입니다.",
'dateFormat' => "은(는) '%s' 형태의 날짜여야 합니다.",
'dateBefore' => "은(는) '%s' 보다 이전이어야 합니다.",
'dateAfter' => "은(는) '%s' 보다 이후여야 합니다.",
'contains' => "은(는) '%s'을(를) 포함해야 합니다.",
'boolean' => "은(는) boolean이어야 합니다.",
'lengthBetween' => "의 길이는 %d에서 %d 사이여야 합니다.",
'creditCard' => "은(는) 올바른 신용카드 번호가 아닙니다.",
'lengthMin' => "의 길이는 %d 이상이어야 합니다.",
'lengthMax' => "의 길이는 %d을(를) 넘을 수 없습니다.",
'instanceOf' => "는 '%s'의 객체여야 합니다."
);

38
lang/lt.php Normal file
View File

@ -0,0 +1,38 @@
<?php
return array(
'required' => "yra privalomas",
'equals' => "reikšmė turi būti tokia pati, kaip „%s“",
'different' => "turi būti kitokia, nei „%s“",
'accepted' => "turi būti priimta",
'numeric' => "turi būti sveikasis skaičius",
'integer' => "turi būti skaičius",
'length' => "turi būti %d ženklų ilgio",
'min' => "turi būti bent %s",
'max' => "turi būti ne daugiau kaip %s",
'listContains' => "turi neteisingą vertę",
'in' => "turi neteisingą vertę",
'notIn' => "turi neteisingą vertę",
'ip' => "nėra teisingas IP adresas",
'ipv4' => "nėra teisingas IPv4 adresas",
'ipv6' => "nėra teisingas IPv6 adresas",
'email' => "nėra teisingas el. pašto adresas",
'url' => "nėra teisingas URL",
'urlActive' => "turi būti aktyvus domenas",
'alpha' => "turi turėti tik raides a-ž",
'alphaNum' => "turi turėti tik raides a-ž ir/ar skaičius 0-9",
'slug' => "turi turėti tik raides a-ž, skaičius 0-9, brukšnelius ir apatinius brukšnelius",
'regex' => "yra neteisingų ženklų",
'date' => "nėra teisinga data",
'dateFormat' => "turi būti „%s“ formato data",
'dateBefore' => "turi būti data, ankstesnė nei „%s“",
'dateAfter' => "turi būti data, vėlesnė nei „%s“",
'contains' => "turi turėti %s",
'boolean' => "turi būti būlio (taip/ne) tipo",
'lengthBetween' => "turi būti nuo %d iki %d ilgio",
'creditCard' => "turi būti teisingas kreditinės kortelės numeris",
'lengthMin' => "turi būti bent %d ženklų ilgio",
'lengthMax' => "turi būti ne ilgesnis nei %d ženklų",
'instanceOf' => "turi būti „%s“ atvejis",
'containsUnique' => "turi turėti tik unikalius elementus",
'subset' => "turi elementą, kurio nėra sąraše"
);

View File

@ -10,6 +10,7 @@ return array(
'length' => "nedrīkst būt garāks par %d simboliem", 'length' => "nedrīkst būt garāks par %d simboliem",
'min' => "jābūt garākam par %s simboliem", 'min' => "jābūt garākam par %s simboliem",
'max' => "jābūt īsākam par %s simboliem", 'max' => "jābūt īsākam par %s simboliem",
'listContains' => "lauks satur nederīgu vērtību",
'in' => "lauks satur nederīgu vērtību", 'in' => "lauks satur nederīgu vērtību",
'notIn' => "lauks satur nederīgu vērtību", 'notIn' => "lauks satur nederīgu vērtību",
'ip' => " lauks nav derīga IP adrese", 'ip' => " lauks nav derīga IP adrese",

39
lang/nb.php Normal file
View File

@ -0,0 +1,39 @@
<?php
// Norwegian Bokmål (nb)
return array(
'required' => "er påkrevd",
'equals' => "må være lik '%s'",
'different' => "må være annerledes enn '%s'",
'accepted' => "må aksepteres",
'numeric' => "må være numerisk",
'integer' => "må være et heltall",
'length' => "må være %d tegn langt",
'min' => "må være minst %s",
'max' => "må ikke være mer enn %s",
'listContains' => "inneholder ugyldig verdi",
'in' => "inneholder ugyldig verdi",
'notIn' => "inneholder ugyldig verdi",
'ip' => "er ikke en gyldig IP adresse",
'ipv4' => "er ikke en gyldig IPv4 adresse",
'ipv6' => "er ikke en gyldig IPv6 adresse",
'email' => "er ikke en gyldig e-postadresse",
'url' => "er ikke en gyldig URL",
'urlActive' => "må være et aktivt domene",
'alpha' => "må bare innholde bokstaver a-z",
'alphaNum' => "må bare innholde bokstaver a-z og/eller tall 0-9",
'slug' => "må bare innholde bokstaver a-z og/eller tall 0-9, bindestreker og understreker",
'regex' => "inneholder ulovlige tegn",
'date' => "er ikke en gyldig dato",
'dateFormat' => "må være en dato med format '%s'",
'dateBefore' => "må være en dato før '%s'",
'dateAfter' => "må være en dato etter '%s'",
'contains' => "må inneholde %s",
'boolean' => "må være en boolsk verdi",
'lengthBetween' => "må være mellom %d og %d tegn",
'creditCard' => "må være et gyldig kredittkortnummer",
'lengthMin' => "må være minst %d tegn langt",
'lengthMax' => "må ikke overstige %d tegn",
'instanceOf' => "må være en instans av '%s'",
'containsUnique'=> "må inneholde kun unike elementer",
'subset' => "inneholder et element som ikke er i listen"
);

View File

@ -2,33 +2,34 @@
return array( return array(
'required' => "is verplicht", 'required' => "is verplicht",
'equals' => "moet gelijk zijn aan'%s'", 'equals' => "moet gelijk zijn aan '%s'",
'different' => "moet verschillend zijn van '%s'", 'different' => "moet verschillend zijn van '%s'",
'accepted' => "moet aanvaard worden", 'accepted' => "moet aanvaard worden",
'numeric' => "moet numeriek zijn", 'numeric' => "moet numeriek zijn",
'integer' => "moet een cijfer zijn (0-9)", 'integer' => "moet een cijfer zijn",
'length' => "moet minstens %d karakters lang zijn", 'length' => "moet minstens %d karakters lang zijn",
'min' => "moet minstens %s zijn", 'min' => "moet minstens %s zijn",
'max' => "mag niet meer zijn dan %s", 'max' => "mag niet meer zijn dan %s",
'listContains' => "bevat een ongeldige waarde",
'in' => "bevat een ongeldige waarde", 'in' => "bevat een ongeldige waarde",
'notIn' => "bevat een ongeldige waarde", 'notIn' => "bevat een ongeldige waarde",
'ip' => "is geen geldig IP-adres", 'ip' => "is geen geldig IP-adres",
'email' => "is geen geldig e-mailadres", 'email' => "is geen geldig e-mailadres",
'url' => "geen URL", 'url' => "is geen geldige URL",
'urlActive' => "moet een actief domein zijn", 'urlActive' => "moet een actief domein zijn",
'alpha' => "mag enkel letters (a-z) bevatten", 'alpha' => "mag enkel letters (a-z) bevatten",
'alphaNum' => "mag enkel letters (a-z) en/of cijfers 0-9 bevatten", 'alphaNum' => "mag enkel letters (a-z) en/of cijfers (0-9) bevatten",
'slug' => "mag enkel letters (a-z), cijfers (0-9) en liggende streepjes (_,-) bevatten", 'slug' => "mag enkel letters (a-z), cijfers (0-9) en liggende streepjes (_,-) bevatten",
'regex' => "bevat ongeldige karakters", 'regex' => "bevat ongeldige karakters",
'date' => "is geen geldige datum", 'date' => "is geen geldige datum",
'dateFormat' => "moet een datum zijn in het formaat '%s'", 'dateFormat' => "moet een datum zijn in het formaat '%s'",
'dateBefore' => "moet een datum voor '%s' zijn", 'dateBefore' => "moet een datum voor '%s' zijn",
'dateAfter' => "moet een datum na '%s' zijn", 'dateAfter' => "moet een datum na '%s' zijn",
'contains' => "moet %s bevatten", 'contains' => "moet '%s' bevatten",
'boolean' => "moet een booleaanse waarde zijn", 'boolean' => "moet een booleaanse waarde zijn",
'lengthBetween' => "moet tussen %d en %d karakters lang zijn", 'lengthBetween' => "moet tussen %d en %d karakters lang zijn",
'creditCard' => "moet een geldig kredietkaartnummer zijn", 'creditCard' => "moet een geldig kredietkaartnummer zijn",
"lengthMin" => "moet meer dan %d karakters lang zijn", "lengthMin" => "moet meer dan %d karakters lang zijn",
"lengthMax" => "moet minder dan %d karakters lang zijn", "lengthMax" => "mag niet meer dan %d karakters lang zijn",
"instanceOf" => "moet een instance van '%s' zijn" "instanceOf" => "moet een instantie zijn van '%s'"
); );

35
lang/nn.php Normal file
View File

@ -0,0 +1,35 @@
<?php
return array(
'required' => "er nødvendig",
'equals' => "må være de samme som '%s'",
'different' => "må være annerledes enn '%s'",
'accepted' => "må aksepteres",
'numeric' => "må være numerisk",
'integer' => "må være et heltall",
'length' => "må være %d tegn",
'min' => "må være minst %s",
'max' => "må ikke være mer enn %s",
'listContains' => "inneholder ugyldig verdi",
'in' => "inneholder ugyldig verdi",
'notIn' => "inneholder ugyldig verdi",
'ip' => "er ikkje ein gyldig IP Adresse",
'email' => "er ikkje ein gyldig E-post adresse",
'url' => "er ikkje ein gyldig URL",
'urlActive' => "må være eit aktivt domene",
'alpha' => "må bare innholde bokstaver a-z",
'alphaNum' => "må bare innholde bokstaver a-z og/eller tall 0-9",
'slug' => "må bare innholde bokstaver a-z og/eller tall 0-9, bindestreker og understreker",
'regex' => "inneholder ulovlige tegn",
'date' => "er ikkje ein gylid dato",
'dateFormat' => "må være ein dato med formatet '%s'",
'dateBefore' => "må være ein dato før '%s'",
'dateAfter' => "må være ein dato etter '%s'",
'contains' => "må inneholde %s",
'boolean' => "må være ein boolsk verdi",
'lengthBetween' => "må være imellom %d og %d tegn",
'creditCard' => "må være et gyldig kredittkortnummer",
'lengthMin' => "må være minst %d tegn",
'lengthMax' => "må ikkje overstige %d tegn",
'instanceOf' => "må være ein instans av '%s'"
);

3
lang/no.php Normal file
View File

@ -0,0 +1,3 @@
<?php
return include __DIR__ . '/nn.php';

View File

@ -6,10 +6,11 @@ return array(
'different' => "musi być różne od '%s'", 'different' => "musi być różne od '%s'",
'accepted' => "musi być zaakceptowane", 'accepted' => "musi być zaakceptowane",
'numeric' => "musi być liczbą", 'numeric' => "musi być liczbą",
'integer' => "musi być liczbą całkowitą (0-9)", 'integer' => "musi być liczbą całkowitą",
'length' => "musi być dłuższe niż %d", 'length' => "musi być dłuższe niż %d",
'min' => "musi być przynajmniej %s", 'min' => "musi być przynajmniej %s",
'max' => "nie może być większe niż %s", 'max' => "nie może być większe niż %s",
'listContains' => "zawiera nieprawidłową wartość",
'in' => "zawiera nieprawidłową wartość", 'in' => "zawiera nieprawidłową wartość",
'notIn' => "zawiera nieprawidłową wartość", 'notIn' => "zawiera nieprawidłową wartość",
'ip' => "nie jest prawidłowym adresem IP", 'ip' => "nie jest prawidłowym adresem IP",

View File

@ -1,28 +1,37 @@
<?php <?php
return array( return array(
'required' => "é obrigatório", 'required' => "é obrigatório",
'equals' => "deve ser o mesmo que '%s'", 'equals' => "deve ser o mesmo que '%s'",
'different' => "deve ser diferente de '%s'", 'different' => "deve ser diferente de '%s'",
'accepted' => "deve ser aceito", 'accepted' => "deve ser aceito",
'numeric' => "deve ser um número", 'numeric' => "deve ser um número",
'integer' => "deve ser um inteiro (0-9)", 'integer' => "deve ser um inteiro",
'length' => "deve ter %d caracteres", 'length' => "deve ter %d caracteres",
'min' => "deve ser maior que %s", 'min' => "deve ser maior que %s",
'max' => "deve ser menor que %s", 'max' => "deve ser menor que %s",
'in' => "contém um valor inválido", 'in' => "contém um valor inválido",
'notIn' => "contém um valor inválido", 'notIn' => "contém um valor inválido",
'ip' => "não é um IP válido", 'ip' => "não é um IP válido",
'email' => "não é um email válido", 'email' => "não é um email válido",
'url' => "não é uma URL válida", 'url' => "não é uma URL válida",
'urlActive' => "deve ser um domínio ativo", 'urlActive' => "deve ser um domínio ativo",
'alpha' => "deve conter as letras a-z", 'alpha' => "deve conter as letras a-z",
'alphaNum' => "deve conter apenas letras a-z e/ou números 0-9", 'alphaNum' => "deve conter apenas letras a-z e/ou números 0-9",
'slug' => "deve conter apenas letras a-z, números 0-9, ou os caracteres - ou _", 'slug' => "deve conter apenas letras a-z, números 0-9, ou os caracteres - ou _",
'regex' => "contém caracteres inválidos", 'regex' => "contém caracteres inválidos",
'date' => "não é uma data válida", 'date' => "não é uma data válida",
'dateFormat' => "deve ser uma data no formato '%s'", 'dateFormat' => "deve ser uma data no formato '%s'",
'dateBefore' => "deve ser uma data anterior a '%s'", 'dateBefore' => "deve ser uma data anterior a '%s'",
'dateAfter' => "deve ser uma data posterior a '%s'", 'dateAfter' => "deve ser uma data posterior a '%s'",
'contains' => "deve conter %s" 'contains' => "deve conter %s",
); 'boolean' => "deve ser um booleano",
'lengthBetween' => "deve estar entre %d e %d caracteres",
'creditCard' => "deve ser um numero de cartão de credito válido",
'lengthMin' => "deve ter ao menos %d caracteres",
'lengthMax' => "não deve exceder %d caracteres",
'instanceOf' => "deve ser uma instância de '%s'",
'containsUnique' => "deve conter apenas valores únicos",
'subset' => "contém um item que não está na lista",
'arrayHasKeys' => "não contém todas as chaves requeridas"
);

View File

@ -6,10 +6,11 @@ return array(
'different' => "trebuie sa fie diferit de '%s'", 'different' => "trebuie sa fie diferit de '%s'",
'accepted' => "trebuie sa fie acceptat", 'accepted' => "trebuie sa fie acceptat",
'numeric' => "trebuie sa fie numeric", 'numeric' => "trebuie sa fie numeric",
'integer' => "trebuie sa fie intreg (0-9)", 'integer' => "trebuie sa fie intreg",
'length' => "trebuie sa fie mai lung decat %d", 'length' => "trebuie sa fie mai lung decat %d",
'min' => "trebuie sa fie cel putin %s", 'min' => "trebuie sa fie cel putin %s",
'max' => "nu trebuie sa fie mai mult de %s", 'max' => "nu trebuie sa fie mai mult de %s",
'listContains' => "contine caractere invalide",
'in' => "contine caractere invalide", 'in' => "contine caractere invalide",
'notIn' => "contine o valoare invalida", 'notIn' => "contine o valoare invalida",
'ip' => "nu este o adresa IP valida", 'ip' => "nu este o adresa IP valida",

View File

@ -1,33 +1,39 @@
<?php <?php
return array( return array(
'required' => "обязательно для заполнения", 'required' => "обязательно для заполнения",
'equals' => "должно содержать '%s'", 'equals' => "должно совпадать со значением '%s'",
'different' => "должно отличаться от '%s'", 'different' => "должно отличаться от '%s'",
'accepted' => "должно быть указано", 'accepted' => "должно быть указано",
'numeric' => "должно содержать числовое значение", 'numeric' => "должно содержать числовое значение",
'integer' => "должно быть числом", 'integer' => "должно быть числом",
'length' => "должно быть длиннее, чем %d", 'length' => "должно быть длиннее, чем %d",
'min' => "должно быть больше, чем %s", 'min' => "должно быть не менее, чем %s",
'max' => "должно быть меньше, чем %s", 'max' => "должно быть не более, чем %s",
'in' => "содержит неверное значение", 'listContains' => "содержит неверное значение",
'notIn' => "содержит неверное значение", 'in' => "содержит неверное значение",
'ip' => "не является валидным IP адресом", 'notIn' => "содержит неверное значение",
'email' => "не является валидным email адресом", 'ip' => "не является валидным IP адресом",
'url' => "не является ссылкой", 'ipv4' => "не является валидным IPv4 адресом",
'urlActive' => "содержит не активную ссылку", 'ipv6' => "не является валидным IPv6 адресом",
'alpha' => "должно содержать только латинские символы", 'email' => "не является валидным email адресом",
'alphaNum' => "должно содержать только латинские символы и/или цифры", 'url' => "не является валидной ссылкой",
'slug' => "должно содержать только латинские символы, цифры, тире и подчёркивания", 'urlActive' => "содержит не активную ссылку",
'regex' => "содержит недопустимые символы", 'alpha' => "должно содержать только латинские символы",
'date' => "не является датой", 'alphaNum' => "должно содержать только латинские символы и/или цифры",
'dateFormat' => "должно содержать дату следующего формата: %s", 'slug' => "должно содержать только латинские символы, цифры, тире и подчёркивания",
'dateBefore' => "должно содержать дату не позднее, чем %s", 'regex' => "содержит недопустимые символы",
'dateAfter' => "должно содержать дату не ранее, чем %s", 'date' => "не является датой",
'contains' => "должно содержать %s", 'dateFormat' => "должно содержать дату следующего формата: %s",
'boolean' => "должно содержать логическое значение", 'dateBefore' => "должно содержать дату не позднее, чем %s",
'lengthBetween' => "должно содержать от %d до %d символов", 'dateAfter' => "должно содержать дату не ранее, чем %s",
'creditCard' => "должно быть номером кредитной карты", 'contains' => "должно содержать %s",
"lengthMin" => "должно содержать более %d символов", 'boolean' => "должно содержать логическое значение",
"lengthMax" => "должно содержать менее %d символов" 'lengthBetween' => "должно содержать от %d до %d символов",
'creditCard' => "должно быть номером кредитной карты",
'lengthMin' => "должно содержать более %d символов",
'lengthMax' => "должно содержать менее %d символов",
'instanceOf' => "должно быть объектом класса '%s'",
'containsUnique' => "должно содержать только уникальные элементы",
'subset' => "содержит элемент, не указанный в списке",
); );

35
lang/sk.php Normal file
View File

@ -0,0 +1,35 @@
<?php
return array(
'required' => "je povinná položka",
'equals' => "musí byť rovnaký ako '%s'",
'different' => "musí byť rôzny od '%s'",
'accepted' => "musí byť akceptovaný",
'numeric' => "musí byť číslo",
'integer' => "musí byť celé číslo",
'length' => "musí byť dlhý aspoň %d",
'min' => "musí byť dlhý minimálne %s",
'max' => "musí byť maximálne %s",
'listContains' => "obsahuje nepovolenú hodnotu",
'in' => "obsahuje nepovolenú hodnotu",
'notIn' => "obsahuje nepovolenú hodnotu",
'ip' => "nie je korektná IP adresa",
'email' => "nie je korektný e-mail",
'url' => "nie je URL",
'urlActive' => "musí byť aktívna URL",
'alpha' => "musí obsahovať len písmená a-z",
'alphaNum' => "musí obsahovať len písmená a-z a/alebo čísla 0-9",
'slug' => "musí obsahovať len písmená a-z, čísla 0-9, pomlčky alebo podtržítka",
'regex' => "obsahuje nepovolené znaky",
'date' => "nie je korektný formáť",
'dateFormat' => "musí byť dátum formátu '%s'",
'dateBefore' => "musí byť dátum pred '%s'",
'dateAfter' => "musí byť dátum po '%s'",
'contains' => "musí obsahovať %s",
'boolean' => "musí byť pravdivostná hodnota (boolean)",
'lengthBetween' => "musí byť %d až %d znakov dlhý",
'creditCard' => "musí byť korektné číslo kreditnej karty",
"lengthMin" => "musí byť aspoň %d znakov dlhý",
"lengthMax" => "musí byť najviac %d znakov dlhý",
"instanceOf" => "musí byť inštanciou '%s'"
);

42
lang/sl.php Normal file
View File

@ -0,0 +1,42 @@
<?php
return array(
'required' => "potrebno",
'equals' => "mora biti enak '% s'",
'different' => "mora biti drugačen od '% s'",
'accepted' => "mora biti označeno",
'numeric' => "mora biti številka",
'integer' => "mora biti celo število",
'length' => "ne sme biti daljši od% d",
'min' => "mora biti večji od% s",
'max' => "mora biti manjši od% s",
'listContains' => "vsebuje neveljavno vrednost",
'in' => "vsebuje neveljavno vrednost",
'notIn' => "vsebuje neveljavno vrednost",
'ip' => "ni veljaven naslov IP",
'ipv4' => "ni veljaven naslov IPv4",
'ipv6' => "ni veljaven naslov IPv6",
'email' => "ni veljaven e-poštni naslov",
'url' => "ni veljaven URL",
'urlActive' => "mora biti aktivna domena",
'alpha' => "mora vsebovati samo črke a-z",
'alphaNum' => "mora vsebovati samo črke a-z in / ali številke 0-9",
'slug' => "mora vsebovati samo črke a-z, številke 0-9, črtice in podčrtaje",
'regex' => "vsebuje neveljavne znake",
'date' => "ni veljaven datum",
'dateFormat' => "mora biti datum s formatom '% s'",
'dateBefore' => "mora biti datum pred '% s'",
'dateAfter' => "mora biti datum za '% s'",
'contains' => "mora vsebovati% s",
'boolean' => "mora biti boolean",
'lengthBetween' => "mora biti med% d in% d znaki",
'creditCard' => "mora biti veljavna številka kreditne kartice",
'lengthMin' => "mora biti dolg vsaj% d znakov",
'lengthMax' => "ne sme presegati% d znakov",
'instanceOf' => "mora biti primerek '% s'",
'containsUnique' => "mora vsebovati samo edinstvene elemente",
'requiredWith' => "je potrebno",
'requiredWithout'=> "je potrebno",
'subset' => "vsebuje element, ki ga ni na seznamu",
'arrayHasKeys' => "ne vsebuje vseh potrebnih tipk",
);

35
lang/sv.php Normal file
View File

@ -0,0 +1,35 @@
<?php
return array(
'required' => "är obligatorisk",
'equals' => "måste vara samma som '%s'",
'different' => "får inte vara samma som '%s'",
'accepted' => "måste accepteras",
'numeric' => "måste vara numerisk",
'integer' => "måste vara ett heltal",
'length' => "måste vara %d tecken långt",
'min' => "måste vara minst %s",
'max' => "får inte vara mer än %s",
'listContains' => "innehåller ogiltigt värde",
'in' => "innehåller ogiltigt värde",
'notIn' => "innehåller ogiltigt värde",
'ip' => "är inte en giltig IP-adress",
'email' => "är inte en giltig e-postadress",
'url' => "är inte en giltig URL",
'urlActive' => "måste vara ett aktivt domännamn",
'alpha' => "får bara innehålla bokstäver a-z",
'alphaNum' => "får bara innehålla bokstäver a-z och/eller siffror 0-9",
'slug' => "får bara innehålla bokstäver a-z och/eller siffror 0-9, bindesstreck och understreck",
'regex' => "innehåller ogiltiga tecken",
'date' => "är inte ett giltigt datum",
'dateFormat' => "måste vara ett datum med formatet '%s'",
'dateBefore' => "måste vara ett datum före '%s'",
'dateAfter' => "måste vara ett datum efter '%s'",
'contains' => "måste innehålla %s",
'boolean' => "måste vara ett booleskt värde",
'lengthBetween' => "måste vara mellan %d och %d tecken långt",
'creditCard' => "måste vara ett giltigt kreditkortsnummer",
'lengthMin' => "måste vara minst %d tecken långt",
'lengthMax' => "får inte överstiga %d tecken",
'instanceOf' => "måste vara en instans av '%s'"
);

View File

@ -6,10 +6,11 @@ return array(
'different' => "ต้องแตกต่างจาก '%s'", 'different' => "ต้องแตกต่างจาก '%s'",
'accepted' => "ต้องถูกยอมรับ", 'accepted' => "ต้องถูกยอมรับ",
'numeric' => "ต้องเป็นตัวเลข", 'numeric' => "ต้องเป็นตัวเลข",
'integer' => "ต้องเป็นตัวเลข integer (0-9)", 'integer' => "ต้องเป็นตัวเลข integer",
'length' => "ต้องมีความยาวมากกว่า %d", 'length' => "ต้องมีความยาวมากกว่า %d",
'min' => "ต้องมีอย่างน้อย %s", 'min' => "ต้องมีอย่างน้อย %s",
'max' => "ต้องไม่มากเกิน %s", 'max' => "ต้องไม่มากเกิน %s",
'listContains' => "ประกอบด้วยค่าที่ไม่ถูกต้อง",
'in' => "ประกอบด้วยค่าที่ไม่ถูกต้อง", 'in' => "ประกอบด้วยค่าที่ไม่ถูกต้อง",
'notIn' => "ประกอบด้วยค่าที่ไม่ถูกต้อง", 'notIn' => "ประกอบด้วยค่าที่ไม่ถูกต้อง",
'ip' => "ไม่ใช่ IP ที่ถูกต้อง", 'ip' => "ไม่ใช่ IP ที่ถูกต้อง",

View File

@ -6,10 +6,11 @@ return array(
'different' => "bundan değişik olmalı '%s'", 'different' => "bundan değişik olmalı '%s'",
'accepted' => "kabul edilebilir olmalı", 'accepted' => "kabul edilebilir olmalı",
'numeric' => "numerik olmalı", 'numeric' => "numerik olmalı",
'integer' => "sayı olmalı (0-9)", 'integer' => "sayı olmalı",
'length' => "en az %d adet uzunluğunda olmalı", 'length' => "en az %d adet uzunluğunda olmalı",
'min' => "en az böyle olmalı %s", 'min' => "en az böyle olmalı %s",
'max' => "bundan daha fazla olmalı %s", 'max' => "bundan daha fazla olmalı %s",
'listContains' => "geçersiz değer içeriyor",
'in' => "geçersiz değer içeriyor", 'in' => "geçersiz değer içeriyor",
'notIn' => "geçersiz değer içeriyor", 'notIn' => "geçersiz değer içeriyor",
'ip' => "geçerli bir IP adresi değil", 'ip' => "geçerli bir IP adresi değil",
@ -28,7 +29,7 @@ return array(
'boolean' => "boolean olmalı", 'boolean' => "boolean olmalı",
'lengthBetween' => "%d ve %d karakter arasında olmalı", 'lengthBetween' => "%d ve %d karakter arasında olmalı",
'creditCard' => "geçerli bir kredi kartı numarası olmalı", 'creditCard' => "geçerli bir kredi kartı numarası olmalı",
"lengthMin" => "%d katakterden fazla içermeli", "lengthMin" => "%d karakterden fazla içermeli",
"lengthMax" => "%d karakterden az içermeli", "lengthMax" => "%d karakterden az içermeli",
"instanceOf" => "bunun bir örneği olmalı '%s'" "instanceOf" => "bunun bir örneği olmalı '%s'"
); );

View File

@ -10,6 +10,7 @@ return array(
'length' => "має бути довшим, ніж %d", 'length' => "має бути довшим, ніж %d",
'min' => "має бути більше, ніж %s", 'min' => "має бути більше, ніж %s",
'max' => "повинно бути менше, ніж %s", 'max' => "повинно бути менше, ніж %s",
'listContains' => "містить невірне значення",
'in' => "містить невірне значення", 'in' => "містить невірне значення",
'notIn' => "містить невірне значення", 'notIn' => "містить невірне значення",
'ip' => "не є валідною IP адресою", 'ip' => "не є валідною IP адресою",

View File

@ -6,10 +6,11 @@ return array(
'different' => "phải khác '%s'", 'different' => "phải khác '%s'",
'accepted' => "được chấp nhận", 'accepted' => "được chấp nhận",
'numeric' => "phải là số", 'numeric' => "phải là số",
'integer' => "phải là số nguyên (0-9)", 'integer' => "phải là số nguyên",
'length' => "phải dài hơn %d", 'length' => "phải dài hơn %d",
'min' => "ít nhất %s", 'min' => "ít nhất %s",
'max' => "tối đa %s", 'max' => "tối đa %s",
'listContains' => "chứa giá trị không hợp lệ",
'in' => "chứa giá trị không hợp lệ", 'in' => "chứa giá trị không hợp lệ",
'notIn' => "chứa giá trị không hợp lệ", 'notIn' => "chứa giá trị không hợp lệ",
'ip' => "địa chỉ IP không hợp lệ", 'ip' => "địa chỉ IP không hợp lệ",

View File

@ -6,10 +6,11 @@ return array(
'different' => "必须和 '%s' 不一致", 'different' => "必须和 '%s' 不一致",
'accepted' => "必须接受", 'accepted' => "必须接受",
'numeric' => "只能是数字", 'numeric' => "只能是数字",
'integer' => "只能是整数(0-9)", 'integer' => "只能是整数",
'length' => "长度必须于 %d", 'length' => "长度必须于 %d",
'min' => "必须大于 %s", 'min' => "必须大于 %s",
'max' => "必须小于 %s", 'max' => "必须小于 %s",
'listContains' => "无效的值",
'in' => "无效的值", 'in' => "无效的值",
'notIn' => "无效的值", 'notIn' => "无效的值",
'ip' => "无效IP地址", 'ip' => "无效IP地址",
@ -24,5 +25,16 @@ return array(
'dateFormat' => "日期的格式应该为 '%s'", 'dateFormat' => "日期的格式应该为 '%s'",
'dateBefore' => "日期必须在 '%s' 之前", 'dateBefore' => "日期必须在 '%s' 之前",
'dateAfter' => "日期必须在 '%s' 之后", 'dateAfter' => "日期必须在 '%s' 之后",
'contains' => "必须包含 %s" 'contains' => "必须包含 %s",
'boolean' => "必须是真或假",
'lengthBetween' => "长度只能介于 %d 和 %d 之间",
'creditCard' => "信用卡号码不正确",
'lengthMin' => "长度必须大于 %d",
'lengthMax' => "长度必须小于 %d",
'instanceOf' => "必须是 '%s' 的实例",
'containsUnique' => "必须仅包含唯一的元素",
'requiredWith' => "是必须的",
'requiredWithout' => "是必须的",
'subset' => "包含不在列表中的项目",
'arrayHasKeys' => "不包含所有必需的键",
); );

View File

@ -1,28 +1,40 @@
<?php <?php
return array( return array(
'required' => "不能為空", 'required' => "不能為空",
'equals' => "必須和 '%s' 一致", 'equals' => "必須和 '%s' 一致",
'different' => "必須和 '%s' 不一致", 'different' => "必須和 '%s' 不一致",
'accepted' => "必須接受", 'accepted' => "必須接受",
'numeric' => "只能是數字", 'numeric' => "只能是數字",
'integer' => "只能是整數(0-9)", 'integer' => "只能是整數",
'length' => "長度必須大於 %d", 'length' => "長度必須大於 %d",
'min' => "必須大於 %s", 'min' => "必須大於 %s",
'max' => "必須小於 %s", 'max' => "必須小於 %s",
'in' => "無效的值", 'listContains' => "無效的值",
'notIn' => "無效的值", 'in' => "無效的值",
'ip' => "無效IP地址", 'notIn' => "無效的值",
'email' => "無效郵箱地址", 'ip' => "無效IP地址",
'url' => "無效的URL", 'email' => "無效郵箱地址",
'urlActive' => "必須是可用的域名", 'url' => "無效的URL",
'alpha' => "只能包括英文字母(a-z)", 'urlActive' => "必須是可用的域名",
'alphaNum' => "只能包括英文字母(a-z)和數字(0-9)", 'alpha' => "只能包括英文字母(a-z)",
'slug' => "只能包括英文字母(a-z)、數字(0-9)、破折號和下劃線", 'alphaNum' => "只能包括英文字母(a-z)和數字(0-9)",
'regex' => "無效格式", 'slug' => "只能包括英文字母(a-z)、數字(0-9)、破折號和下劃線",
'date' => "無效的日期", 'regex' => "無效格式",
'dateFormat' => "日期的格式應該為 '%s'", 'date' => "無效的日期",
'dateBefore' => "日期必須在 '%s' 之前", 'dateFormat' => "日期的格式應該為 '%s'",
'dateAfter' => "日期必須在 '%s' 之後", 'dateBefore' => "日期必須在 '%s' 之前",
'contains' => "必須包含 %s" 'dateAfter' => "日期必須在 '%s' 之後",
'contains' => "必須包含 %s",
'boolean' => "必須是真或假",
'lengthBetween' => "長度只能介於 %d 和 %d 之間",
'creditCard' => "信用卡號碼不正確",
'lengthMin' => "長度必須大於 %d",
'lengthMax' => "長度必須小於 %d",
'instanceOf' => "必須是 '%s' 的實例",
'containsUnique' => "必須僅包含唯一的元素",
'requiredWith' => "是必須的",
'requiredWithout' => "是必須的",
'subset' => "包含不在列表中的項目",
'arrayHasKeys' => "不包含所有必需的鍵",
); );

View File

@ -7,7 +7,6 @@
convertWarningsToExceptions="true" convertWarningsToExceptions="true"
processIsolation="false" processIsolation="false"
stopOnFailure="false" stopOnFailure="false"
syntaxCheck="false"
bootstrap="tests/bootstrap.php" bootstrap="tests/bootstrap.php"
> >
<testsuites> <testsuites>

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
<?php <?php
class BaseTestCase extends \PHPUnit_Framework_TestCase use PHPUnit\Framework\TestCase;
{
public function setUp()
{
}
class BaseTestCase extends TestCase
{
/*
public function tearDown() public function tearDown()
{ {
$this->resetProperty('_lang'); $this->resetProperty('_lang');
@ -16,9 +16,10 @@ class BaseTestCase extends \PHPUnit_Framework_TestCase
protected function resetProperty($name, $value = null) protected function resetProperty($name, $value = null)
{ {
$prop = new ReflectionProperty('Valitron\Validator', $name); $prop = new \ReflectionProperty('Valitron\Validator', $name);
$prop->setAccessible(true); $prop->setAccessible(true);
$prop->setValue($value); $prop->setValue($value);
$prop->setAccessible(false); $prop->setAccessible(false);
} }
*/
} }

View File

@ -1,4 +1,5 @@
<?php <?php
use Valitron\Validator; use Valitron\Validator;
class ErrorMessagesTest extends BaseTestCase class ErrorMessagesTest extends BaseTestCase
@ -11,12 +12,25 @@ class ErrorMessagesTest extends BaseTestCase
$this->assertSame(array("Name is required"), $v->errors('name')); $this->assertSame(array("Name is required"), $v->errors('name'));
} }
/**
* Test the disabling of prepending the field labels
* to error messages.
*/
public function testErrorMessageExcludeFieldName()
{
$v = new Validator(array());
$v->setPrependLabels(false);
$v->rule('required', 'name');
$v->validate();
$this->assertSame(array("is required"), $v->errors('name'));
}
public function testAccurateErrorMessageParams() public function testAccurateErrorMessageParams()
{ {
$v = new Validator(array('num' => 5)); $v = new Validator(array('num' => 5));
$v->rule('min', 'num', 6); $v->rule('min', 'num', 6);
$v->validate(); $v->validate();
$this->assertSame(array("Num must be greater than 6"), $v->errors('num')); $this->assertSame(array("Num must be at least 6"), $v->errors('num'));
} }
public function testCustomErrorMessage() public function testCustomErrorMessage()
@ -57,5 +71,21 @@ class ErrorMessagesTest extends BaseTestCase
$errors = $v->errors(); $errors = $v->errors();
$this->assertEquals($messages, $errors); $this->assertEquals($messages, $errors);
} }
public function testMessageWithFieldSet()
{
$v = new Validator(array('name' => ''), array(), 'en', __DIR__ . '/../lang');
$v->rule('required', 'name');
$v->validate();
$this->assertEquals($v->errors('name'), array('A value is required for Name'));
}
public function testMessageWithFieldAndLabelSet()
{
$v = new Validator(array('name' => ''), array(), 'en', __DIR__ . '/../lang');
$v->rule('required', 'name')->label('my name');
$v->validate();
$this->assertEquals($v->errors('name'), array('A value is required for my name'));
}
} }

View File

@ -9,18 +9,18 @@ class LangTest extends BaseTestCase
} }
/** /**
* Lang defined statically should not be overrided by constructor default * Lang defined statically should not be override by constructor default
*/ */
public function testLangDefinedStatically() public function testLangDefinedStatically()
{ {
$lang = 'ar'; $lang = 'ar';
Validator::lang($lang); Validator::lang($lang);
$validator = new Validator(array());
$this->assertEquals($lang, Validator::lang()); $this->assertEquals($lang, Validator::lang());
Validator::lang('en');
} }
/** /**
* LangDir defined statically should not be overrided by constructor default * LangDir defined statically should not be override by constructor default
*/ */
public function testLangDirDefinedStatically() public function testLangDirDefinedStatically()
{ {
@ -42,12 +42,23 @@ class LangTest extends BaseTestCase
$this->assertEquals(realpath($this->getLangDir()), realpath(Validator::langDir())); $this->assertEquals(realpath($this->getLangDir()), realpath(Validator::langDir()));
} }
/**
* @expectedException InvalidArgumentException
* @expectedExceptionMessage fail to load language file '/this/dir/does/not/exists/en.php'
*/
public function testLangException() public function testLangException()
{ {
try{
new Validator(array(), array(), 'en', '/this/dir/does/not/exists'); new Validator(array(), array(), 'en', '/this/dir/does/not/exists');
} catch (Exception $exception){
$this->assertInstanceOf("InvalidArgumentException", $exception);
$this->assertEquals("Fail to load language file '/this/dir/does/not/exists/en.php'", $exception->getMessage());
}
} }
public function testLoadingNorwegianLoadsNNVariant(){
$validator = new Validator(array(), array(),'no', $this->getLangDir());
$validator->rule('required','test');
$validator->validate();
$errors =$validator->errors('test');
$this->assertEquals('Test er nødvendig', $errors[0]);
}
} }

View File

@ -0,0 +1,102 @@
<?php
use Valitron\Validator;
class MapRulesTest extends BaseTestCase
{
public function testMapSingleFieldRules()
{
$rules = array(
'required',
array('lengthMin', 4)
);
$v = new Validator(array());
$v->mapFieldRules('myField', $rules);
$this->assertFalse($v->validate());
$this->assertEquals(2, sizeof($v->errors('myField')));
$v2 = new Validator(array('myField' => 'myVal'));
$v2->mapFieldRules('myField', $rules);
$this->assertTrue($v2->validate());
}
public function testSingleFieldDot()
{
$v = new Valitron\Validator(array(
'settings' => array(
array('threshold' => 50),
array('threshold' => 90)
)
));
$v->mapFieldRules('settings.*.threshold', array(
array('max', 50)
));
$this->assertFalse($v->validate());
}
public function testMapMultipleFieldsRules()
{
$rules = array(
'myField1' => array(
'required',
array('lengthMin', 4)
),
'myField2' => array(
'required',
array('lengthMin', 5)
)
);
$v = new Validator(array(
'myField1' => 'myVal'
));
$v->mapFieldsRules($rules);
$this->assertFalse($v->validate());
$this->assertFalse($v->errors('myField1'));
$this->assertEquals(2, sizeof($v->errors('myField2')));
}
public function testCustomMessageSingleField()
{
$rules = array(
array('lengthMin', 14, 'message' => 'My Custom Error')
);
$v = new Validator(array(
'myField' => 'myVal'
));
$v->mapFieldRules('myField', $rules);
$this->assertFalse($v->validate());
$errors = $v->errors('myField');
$this->assertEquals('My Custom Error', $errors[0]);
}
public function testCustomMessageMultipleFields()
{
$rules = array(
'myField1' => array(
array('lengthMin', 14, 'message' => 'My Custom Error 1')
),
'myField2' => array(
array('lengthMin', 14, 'message' => 'My Custom Error 2')
)
);
$v = new Validator(array(
'myField1' => 'myVal',
'myField2' => 'myVal',
));
$v->mapFieldsRules($rules);
$this->assertFalse($v->validate());
$errors1 = $v->errors('myField1');
$this->assertEquals('My Custom Error 1', $errors1[0]);
$errors2 = $v->errors('myField2');
$this->assertEquals('My Custom Error 2', $errors2[0]);
}
}

View File

@ -7,8 +7,10 @@ class StaticVsInstanceTest extends BaseTestCase
{ {
Validator::lang('ar'); Validator::lang('ar');
new Validator(array(), array(), 'en'); new Validator(array(), array(), 'en');
$this->assertEquals('ar', Validator::lang(), $this->assertEquals(
'instance defined lang should not replace static global lang'); 'ar', Validator::lang(), 'instance defined lang should not replace static global lang'
);
Validator::lang('en');
} }
/** /**

View File

@ -0,0 +1,28 @@
<?php
use Valitron\Validator;
class StopOnFirstFail extends BaseTestCase
{
public function testStopOnFirstFail()
{
$rules = array(
'myField1' => array(
array('lengthMin', 5, 'message' => 'myField1 must be 5 characters minimum'),
array('url', 'message' => 'myField1 is not a valid url'),
array('urlActive', 'message' => 'myField1 is not an active url')
)
);
$v = new Validator(array(
'myField1' => 'myVal'
));
$v->mapFieldsRules($rules);
$v->stopOnFirstFail(true);
$this->assertFalse($v->validate());
$errors = $v->errors();
$this->assertCount(1, $errors['myField1']);
}
}

View File

@ -0,0 +1,120 @@
<?php
use Valitron\Validator;
function callbackTestFunction($item, $value)
{
return $value === "bar";
}
class ValidateAddInstanceRuleTest extends BaseTestCase
{
/**
* @param Validator $v
*/
protected function assertValid($v)
{
$msg = "\tErrors:\n";
$status = $v->validate();
foreach ($v->errors() as $label => $messages) {
foreach ($messages as $theMessage) {
$msg .= "\n\t{$label}: {$theMessage}";
}
}
$this->assertTrue($v->validate(), $msg);
}
public function testAddInstanceRule()
{
$v = new Validator(array(
"foo" => "bar",
"fuzz" => "bazz",
));
$v->addInstanceRule("fooRule", function ($field, $value) {
return $field !== "foo" || $value !== "barz";
});
Validator::addRule("fuzzerRule", function ($field, $value) {
return $field !== "fuzz" || $value === "bazz";
});
$v->rule("required", array("foo", "fuzz"));
$v->rule("fuzzerRule", "fuzz");
$v->rule("fooRule", "foo");
$this->assertValid($v);
}
public function testAddInstanceRuleFail()
{
$v = new Validator(array("foo" => "bar"));
$v->addInstanceRule("fooRule", function ($field) {
return $field === "for";
});
$v->rule("fooRule", "foo");
$this->assertFalse($v->validate());
}
public function testAddAddRuleWithCallback()
{
$v = new Validator(array("foo" => "bar"));
$v->rule(function ($field, $value) {
return $field === "foo" && $value === "bar";
}, "foo");
$this->assertValid($v);
}
public function testAddAddRuleWithCallbackFail()
{
$v = new Validator(array("foo" => "baz"));
$v->rule(function ($field, $value) {
return $field === "foo" && $value === "bar";
}, "foo");
$this->assertFalse($v->validate());
}
public function testAddAddRuleWithCallbackFailMessage()
{
$v = new Validator(array("foo" => "baz"));
$v->rule(function ($field, $value) {
return $field === "foo" && $value === "bar";
}, "foo", "test error message");
$this->assertFalse($v->validate());
$errors = $v->errors();
$this->assertArrayHasKey("foo", $errors);
$this->assertCount(1, $errors["foo"]);
$this->assertEquals("Foo test error message", $errors["foo"][0]);
}
public function testAddRuleWithNamedCallbackOk()
{
$v = new Validator(array("bar" => "foo"));
$v->rule("callbackTestFunction", "bar");
$this->assertFalse($v->validate());
}
public function testAddRuleWithNamedCallbackErr()
{
$v = new Validator(array("foo" => "bar"));
$v->rule("callbackTestFunction", "foo");
$this->assertTrue($v->validate());
}
public function testUniqueRuleName()
{
$v = new Validator(array());
$args = array("foo", "bar");
$this->assertEquals("foo_bar_rule", $v->getUniqueRuleName($args));
$this->assertEquals("foo_rule", $v->getUniqueRuleName("foo"));
$v->addInstanceRule("foo_rule", function () {
});
$u = $v->getUniqueRuleName("foo");
$this->assertRegExp("/^foo_rule_[0-9]{1,5}$/", $u);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -16,4 +16,4 @@ if($vendorPos !== false) {
$loader = require __DIR__.'/../vendor/autoload.php'; $loader = require __DIR__.'/../vendor/autoload.php';
} }
require_once __DIR__ . '/Valitron/BaseTestCase.php'; require_once __DIR__ . '/Valitron/BaseTestCase.php';

5
tests/lang/en.php Normal file
View File

@ -0,0 +1,5 @@
<?php
$original = include __DIR__ . '/../../lang/en.php';
$original['required'] = 'A value is required for {field}';
return $original;