Files
opnform-host-nginx/api/resources/lang/pt/validation.php
Chirag Chhatrala d7ce8536c8 Add reCAPTCHA support and update captcha provider handling (#647)
* Add reCAPTCHA support and update captcha provider handling

- Introduced reCAPTCHA as an additional captcha provider alongside hCaptcha.
- Updated form request validation to handle different captcha providers based on user selection.
- Added a new validation rule for reCAPTCHA.
- Modified the forms model to include a 'captcha_provider' field.
- Created a migration to add the 'captcha_provider' column to the forms table.
- Updated frontend components to support dynamic rendering of captcha based on the selected provider.
- Enhanced tests to cover scenarios for both hCaptcha and reCAPTCHA.

These changes improve the flexibility of captcha options available to users, enhancing form security and user experience.

* fix pint

* change comment text

* Refactor captcha implementation and integrate new captcha components

- Removed the old RecaptchaV2 component and replaced it with a new implementation that supports both reCAPTCHA and hCaptcha through a unified CaptchaInput component.
- Updated the OpenForm component to utilize the new CaptchaInput for dynamic captcha rendering based on user-selected provider.
- Cleaned up the package.json by removing the deprecated @hcaptcha/vue3-hcaptcha dependency.
- Enhanced form initialization to set a default captcha provider.
- Improved error handling and cleanup for both reCAPTCHA and hCaptcha scripts.

These changes streamline captcha integration, improve maintainability, and enhance user experience by providing a more flexible captcha solution.

* Refactor captcha error messages and localization support

* Refactor registration process to integrate reCAPTCHA

- Replaced hCaptcha implementation with reCAPTCHA in RegisterController and related test cases.
- Updated validation rules to utilize g-recaptcha-response instead of h-captcha-response.
- Modified RegisterForm component to support reCAPTCHA, including changes to the form data structure and component references.
- Enhanced test cases to reflect the new reCAPTCHA integration, ensuring proper validation and response handling.

These changes improve security and user experience during the registration process by adopting a more widely used captcha solution.

* Fix reCAPTCHA configuration and update RegisterForm styling

- Corrected the configuration key for reCAPTCHA in RegisterController from 'services.recaptcha.secret_key' to 'services.re_captcha.secret_key'.
- Updated the styling of the Captcha input section in RegisterForm.vue to improve layout consistency.

These changes ensure proper reCAPTCHA functionality and enhance the user interface during the registration process.

* Fix reCAPTCHA configuration in RegisterTest to use the correct key format

- Updated the configuration key for reCAPTCHA in RegisterTest from 'services.recaptcha.secret_key' to 'services.re_captcha.secret_key' to ensure proper functionality during tests.

This change aligns the test setup with the recent updates in the reCAPTCHA integration, improving the accuracy of the registration process tests.

---------

Co-authored-by: Julien Nahum <julien@nahum.net>
2024-12-18 16:35:09 +01:00

122 lines
6.9 KiB
PHP

<?php
return [
'accepted' => 'O campo :attribute deve ser aceito.',
'active_url' => 'O campo :attribute não é uma URL válida.',
'after' => 'O campo :attribute deve ser uma data posterior a :date.',
'after_or_equal' => 'O campo :attribute deve ser uma data posterior ou igual a :date.',
'alpha' => 'O campo :attribute só pode conter letras.',
'alpha_dash' => 'O campo :attribute só pode conter letras, números, traços e sublinhados.',
'alpha_num' => 'O campo :attribute só pode conter letras e números.',
'array' => 'O campo :attribute deve ser uma matriz.',
'before' => 'O campo :attribute deve ser uma data anterior a :date.',
'before_or_equal' => 'O campo :attribute deve ser uma data anterior ou igual a :date.',
'between' => [
'numeric' => 'O campo :attribute deve estar entre :min e :max.',
'file' => 'O campo :attribute deve estar entre :min e :max kilobytes.',
'string' => 'O campo :attribute deve estar entre :min e :max caracteres.',
'array' => 'O campo :attribute deve ter entre :min e :max itens.',
],
'boolean' => 'O campo :attribute deve ser verdadeiro ou falso.',
'confirmed' => 'A confirmação do campo :attribute não corresponde.',
'date' => 'O campo :attribute não é uma data válida.',
'date_equals' => 'O campo :attribute deve ser uma data igual a :date.',
'date_format' => 'O campo :attribute não corresponde ao formato :format.',
'different' => 'Os campos :attribute e :other devem ser diferentes.',
'digits' => 'O campo :attribute deve ter :digits dígitos.',
'digits_between' => 'O campo :attribute deve ter entre :min e :max dígitos.',
'dimensions' => 'O campo :attribute tem dimensões de imagem inválidas.',
'distinct' => 'O campo :attribute tem um valor duplicado.',
'email' => 'O campo :attribute deve ser um endereço de e-mail válido.',
'ends_with' => 'O campo :attribute deve terminar com um dos seguintes valores: :values.',
'exists' => 'O :attribute selecionado é inválido.',
'file' => 'O campo :attribute deve ser um arquivo.',
'filled' => 'O campo :attribute deve ter um valor.',
'gt' => [
'numeric' => 'O campo :attribute deve ser maior que :value.',
'file' => 'O campo :attribute deve ser maior que :value kilobytes.',
'string' => 'O campo :attribute deve ser maior que :value caracteres.',
'array' => 'O campo :attribute deve ter mais que :value itens.',
],
'gte' => [
'numeric' => 'O campo :attribute deve ser maior ou igual a :value.',
'file' => 'O campo :attribute deve ser maior ou igual a :value kilobytes.',
'string' => 'O campo :attribute deve ser maior ou igual a :value caracteres.',
'array' => 'O campo :attribute deve ter :value itens ou mais.',
],
'image' => 'O campo :attribute deve ser uma imagem.',
'in' => 'O :attribute selecionado é inválido.',
'in_array' => 'O campo :attribute não existe em :other.',
'integer' => 'O campo :attribute deve ser um número inteiro.',
'ip' => 'O campo :attribute deve ser um endereço IP válido.',
'ipv4' => 'O campo :attribute deve ser um endereço IPv4 válido.',
'ipv6' => 'O campo :attribute deve ser um endereço IPv6 válido.',
'json' => 'O campo :attribute deve ser uma string JSON válida.',
'lt' => [
'numeric' => 'O campo :attribute deve ser menor que :value.',
'file' => 'O campo :attribute deve ser menor que :value kilobytes.',
'string' => 'O campo :attribute deve ser menor que :value caracteres.',
'array' => 'O campo :attribute deve ter menos que :value itens.',
],
'lte' => [
'numeric' => 'O campo :attribute deve ser menor ou igual a :value.',
'file' => 'O campo :attribute deve ser menor ou igual a :value kilobytes.',
'string' => 'O campo :attribute deve ser menor ou igual a :value caracteres.',
'array' => 'O campo :attribute não deve ter mais que :value itens.',
],
'max' => [
'numeric' => 'O campo :attribute não pode ser maior que :max.',
'file' => 'O campo :attribute não pode ser maior que :max kilobytes.',
'string' => 'O campo :attribute não pode ser maior que :max caracteres.',
'array' => 'O campo :attribute não pode ter mais que :max itens.',
],
'mimes' => 'O campo :attribute deve ser um arquivo do tipo: :values.',
'mimetypes' => 'O campo :attribute deve ser um arquivo do tipo: :values.',
'min' => [
'numeric' => 'O campo :attribute deve ser pelo menos :min.',
'file' => 'O campo :attribute deve ter pelo menos :min kilobytes.',
'string' => 'O campo :attribute deve ter pelo menos :min caracteres.',
'array' => 'O campo :attribute deve ter pelo menos :min itens.',
],
'multiple_of' => 'O campo :attribute deve ser um múltiplo de :value',
'not_in' => 'O :attribute selecionado é inválido.',
'not_regex' => 'O formato do campo :attribute é inválido.',
'numeric' => 'O campo :attribute deve ser um número.',
'password' => 'A senha está incorreta.',
'present' => 'O campo :attribute deve estar presente.',
'regex' => 'O formato do campo :attribute é inválido.',
'required' => 'O campo :attribute é obrigatório.',
'required_if' => 'O campo :attribute é obrigatório quando :other é :value.',
'required_unless' => 'O campo :attribute é obrigatório a menos que :other esteja em :values.',
'required_with' => 'O campo :attribute é obrigatório quando :values está presente.',
'required_with_all' => 'O campo :attribute é obrigatório quando :values estão presentes.',
'required_without' => 'O campo :attribute é obrigatório quando :values não está presente.',
'required_without_all' => 'O campo :attribute é obrigatório quando nenhum dos :values está presente.',
'same' => 'Os campos :attribute e :other devem corresponder.',
'size' => [
'numeric' => 'O campo :attribute deve ser :size.',
'file' => 'O campo :attribute deve ser :size kilobytes.',
'string' => 'O campo :attribute deve ser :size caracteres.',
'array' => 'O campo :attribute deve conter :size itens.',
],
'starts_with' => 'O campo :attribute deve começar com um dos seguintes valores: :values.',
'string' => 'O campo :attribute deve ser um texto válido.',
'timezone' => 'O campo :attribute deve ser uma zona válida.',
'unique' => 'O :attribute já está sendo utilizado.',
'uploaded' => 'O :attribute falhou ao ser carregado.',
'url' => 'O formato do campo :attribute é inválido.',
'uuid' => 'O campo :attribute deve ser um UUID válido.',
'custom' => [
'attribute-name' => [
'rule-name' => 'custom-message',
],
],
'attributes' => [],
'invalid_json' => 'Entrada inválida. Por favor, corrija e tente novamente.',
'invalid_captcha' => 'Captcha inválido. Por favor, demonstre que não é um bot.',
'complete_captcha' => 'Por favor, complete o captcha.',
];