- Added localization support for API responses in English and Spanish. - Introduced a middleware to set the API locale based on the Accept-Language header. - Updated various exception messages and validation responses to use localized strings. - Created new language files for English and Spanish translations. - Refactored existing code to replace hardcoded messages with localized strings. - Added tests to verify localization functionality and response correctness.
58 lines
2.7 KiB
PHP
58 lines
2.7 KiB
PHP
<?php
|
|
|
|
return [
|
|
'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
|
|
'array' => 'The :attribute must be an array.',
|
|
'boolean' => 'The :attribute field must be true or false.',
|
|
'confirmed' => 'The :attribute confirmation does not match.',
|
|
'date' => 'The :attribute must be a valid date.',
|
|
'distinct' => 'The :attribute field has a duplicate value.',
|
|
'email' => 'The :attribute must be a valid email address.',
|
|
'exists' => 'The selected :attribute is invalid.',
|
|
'file' => 'The :attribute must be a file.',
|
|
'integer' => 'The :attribute must be an integer.',
|
|
'max' => [
|
|
'array' => 'The :attribute must not have more than :max items.',
|
|
'file' => 'The :attribute must not be greater than :max kilobytes.',
|
|
'numeric' => 'The :attribute must not be greater than :max.',
|
|
'string' => 'The :attribute must not be greater than :max characters.',
|
|
],
|
|
'min' => [
|
|
'array' => 'The :attribute must have at least :min items.',
|
|
'file' => 'The :attribute must be at least :min kilobytes.',
|
|
'numeric' => 'The :attribute must be at least :min.',
|
|
'string' => 'The :attribute must be at least :min characters.',
|
|
],
|
|
'numeric' => 'The :attribute must be a number.',
|
|
'password' => [
|
|
'letters' => 'The :attribute must contain at least one letter.',
|
|
'mixed' => 'The :attribute must contain at least one uppercase and one lowercase letter.',
|
|
'numbers' => 'The :attribute must contain at least one number.',
|
|
'symbols' => 'The :attribute must contain at least one symbol.',
|
|
'uncompromised' => 'The given :attribute has appeared in a data leak. Please choose a different one.',
|
|
],
|
|
'prohibited' => 'The :attribute field is prohibited.',
|
|
'regex' => 'The :attribute format is invalid.',
|
|
'required' => 'The :attribute field is required.',
|
|
'required_with' => 'The :attribute field is required when :values is present.',
|
|
'required_without' => 'The :attribute field is required when :values is not present.',
|
|
'string' => 'The :attribute must be a string.',
|
|
'unique' => 'The :attribute has already been taken.',
|
|
'url' => 'The :attribute must be a valid URL.',
|
|
'uuid' => 'The :attribute must be a valid UUID.',
|
|
'attributes' => [
|
|
'cantidad' => 'quantity',
|
|
'catalog_item_id' => 'product',
|
|
'codigo' => 'code',
|
|
'dni' => 'ID number',
|
|
'email' => 'email',
|
|
'nombre_apellido' => 'full name',
|
|
'oauth_code' => 'authentication code',
|
|
'password' => 'password',
|
|
'password_confirmation' => 'password confirmation',
|
|
'telefono' => 'phone number',
|
|
'tenant_codigo' => 'tenant',
|
|
'variant_id' => 'variant',
|
|
],
|
|
];
|