Skip to content

Commit

Permalink
Merge pull request #76 from bowphp/5.x-ref-update
Browse files Browse the repository at this point in the history
Update default validation translate content
  • Loading branch information
papac committed May 24, 2023
2 parents 9750611 + f0acecf commit a1399f3
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
"require": {
"php": "^8.1",
"bowphp/framework": "^5.0",
"bowphp/meta-manager": "^1.0",
"bowphp/policier": "^2.1"
"bowphp/policier": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^8",
Expand Down
7 changes: 7 additions & 0 deletions config/policier.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@
*/
"iss" => app_env("APP_JWT_ISSUER", "app.example.com"),

/**
* Hashing algorithm being used
*
* HS256, HS384, HS512, ES256, ES384, ES512
*/
"alg" => "HS512",

/**
* Configures the audience
*/
Expand Down
34 changes: 17 additions & 17 deletions frontend/lang/en/validation.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?php

return [
'email' => 'The field {attribute} must be an email.',
'required' => 'The field {attribute} is required.',
'empty' => 'The field {attribute} is missing in the fields to be validated.',
'min' => 'The field {attribute} must be at least {length} characters long.',
'max' => 'The field {attribute} must not exceed {length} characters.',
'same' => 'The field {attribute} must be the same as {value}.',
'number' => 'The field {attribute} must be a number.',
'int' => 'The field {attribute} must be an integer.',
'float' => 'The field {attribute} must be a decimal.',
'email' => 'The {attribute} field must be an email.',
'required' => 'The {attribute} field is required.',
'empty' => 'The {attribute} field is missing in the fields to be validated.',
'min' => 'The {attribute} field must be at least {length} characters long.',
'max' => 'The {attribute} field must not exceed {length} characters.',
'same' => 'The {attribute} field must be the same as {value}.',
'number' => 'The {attribute} field must be a number.',
'int' => 'The {attribute} field must be an integer.',
'float' => 'The {attribute} field must be a decimal.',
'alphanum' => 'Only alphanumeric characters are allowed for field {attribute}.',
'in' => 'The field {attribute} must be one of the following {value}.',
'size' => 'The field {attribute} must be {length} characters long.',
'in' => 'The {attribute} field must be one of the following {value}.',
'size' => 'The {attribute} field must be {length} characters long.',
'lower' => 'Only lowercase letters are allowed for field {attribute}.',
'upper' => 'Only uppercase letters are allowed for field {attribute}.',
'alpha' => 'Only alphabetic characters are allowed for field {attribute}.',
'exists' => 'The field {attribute} does not exists.',
'not_exists' => 'The field {attribute} already exists.',
'unique' => 'The field {attribute} must be unique.',
'date' => 'The field {attribute} must use the format: yyyy-mm-dd',
'datetime' => 'The field {attribute} must use the format: yyyy-mm-dd hh:mm:ss',
'regex' => 'The field {attribute} does not match the pattern',
'exists' => 'The {attribute} field does not exists.',
'not_exists' => 'The {attribute} field already exists.',
'unique' => 'The {attribute} field must be unique.',
'date' => 'The {attribute} field must use the format: yyyy-mm-dd',
'datetime' => 'The {attribute} field must use the format: yyyy-mm-dd hh:mm:ss',
'regex' => 'The {attribute} field does not match the pattern',
];
6 changes: 3 additions & 3 deletions frontend/lang/fr/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
'lower' => "Le champ {attribute} doit avoir un contenu en miniscule.",
'upper' => "Le champ {attribute} doit avoir un contenu en majiscule.",
'alpha' => "Le champ {attribute} doit avoir un contenu en alphabetique.",
'exists' => "le champe {attribute} n'existe pas.",
'not_exists' => "le champ {attribute} existe.",
'unique' => "le champ {attribute} doit être unique.",
'exists' => "Le champ {attribute} n'existe pas.",
'not_exists' => "Le champ {attribute} existe.",
'unique' => "Le champ {attribute} doit être unique.",
'date' => "Le champ {attribute} n'est pas une date au format yyyy-mm-dd",
'datetime' => "Le champ {attribute} n'est pas une date au format yyyy-mm-dd hh:mm:ss",
'regex' => "Le champ {attribute} n'est pas valide",
Expand Down

0 comments on commit a1399f3

Please sign in to comment.