* 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>
122 lines
6.8 KiB
PHP
122 lines
6.8 KiB
PHP
<?php
|
|
|
|
return [
|
|
'accepted' => ':attribute phải được chấp nhận.',
|
|
'active_url' => ':attribute không phải là một URL hợp lệ.',
|
|
'after' => ':attribute phải là một ngày sau ngày :date.',
|
|
'after_or_equal' => ':attribute phải là một ngày sau hoặc bằng ngày :date.',
|
|
'alpha' => ':attribute chỉ có thể chứa các chữ cái.',
|
|
'alpha_dash' => ':attribute chỉ có thể chứa chữ cái, số, dấu gạch ngang và gạch dưới.',
|
|
'alpha_num' => ':attribute chỉ có thể chứa chữ cái và số.',
|
|
'array' => ':attribute phải là một mảng.',
|
|
'before' => ':attribute phải là một ngày trước ngày :date.',
|
|
'before_or_equal' => ':attribute phải là một ngày trước hoặc bằng ngày :date.',
|
|
'between' => [
|
|
'numeric' => ':attribute phải nằm trong khoảng :min và :max.',
|
|
'file' => ':attribute phải nằm trong khoảng :min và :max kilobytes.',
|
|
'string' => ':attribute phải nằm trong khoảng :min và :max ký tự.',
|
|
'array' => ':attribute phải có từ :min đến :max phần tử.',
|
|
],
|
|
'boolean' => ':attribute phải là true hoặc false.',
|
|
'confirmed' => 'Xác nhận :attribute không khớp.',
|
|
'date' => ':attribute không phải là ngày hợp lệ.',
|
|
'date_equals' => ':attribute phải là một ngày bằng với :date.',
|
|
'date_format' => ':attribute không khớp với định dạng :format.',
|
|
'different' => ':attribute và :other phải khác nhau.',
|
|
'digits' => ':attribute phải có :digits chữ số.',
|
|
'digits_between' => ':attribute phải có từ :min đến :max chữ số.',
|
|
'dimensions' => ':attribute có kích thước hình ảnh không hợp lệ.',
|
|
'distinct' => ':attribute có giá trị trùng lặp.',
|
|
'email' => ':attribute phải là một địa chỉ email hợp lệ.',
|
|
'ends_with' => ':attribute phải kết thúc bằng một trong những giá trị sau: :values.',
|
|
'exists' => ':attribute đã chọn không hợp lệ.',
|
|
'file' => ':attribute phải là một tập tin.',
|
|
'filled' => ':attribute không được bỏ trống.',
|
|
'gt' => [
|
|
'numeric' => ':attribute phải lớn hơn :value.',
|
|
'file' => ':attribute phải lớn hơn :value kilobytes.',
|
|
'string' => ':attribute phải có nhiều hơn :value ký tự.',
|
|
'array' => ':attribute phải có nhiều hơn :value phần tử.',
|
|
],
|
|
'gte' => [
|
|
'numeric' => ':attribute phải lớn hơn hoặc bằng :value.',
|
|
'file' => ':attribute phải lớn hơn hoặc bằng :value kilobytes.',
|
|
'string' => ':attribute phải có ít nhất :value ký tự.',
|
|
'array' => ':attribute phải có ít nhất :value phần tử.',
|
|
],
|
|
'image' => ':attribute phải là hình ảnh.',
|
|
'in' => ':attribute đã chọn không hợp lệ.',
|
|
'in_array' => ':attribute không tồn tại trong :other.',
|
|
'integer' => ':attribute phải là số nguyên.',
|
|
'ip' => ':attribute phải là một địa chỉ IP hợp lệ.',
|
|
'ipv4' => ':attribute phải là một địa chỉ IPv4 hợp lệ.',
|
|
'ipv6' => ':attribute phải là một địa chỉ IPv6 hợp lệ.',
|
|
'json' => ':attribute phải là một chuỗi JSON hợp lệ.',
|
|
'lt' => [
|
|
'numeric' => ':attribute phải nhỏ hơn :value.',
|
|
'file' => ':attribute phải nhỏ hơn :value kilobytes.',
|
|
'string' => ':attribute phải có ít hơn :value ký tự.',
|
|
'array' => ':attribute phải có ít hơn :value phần tử.',
|
|
],
|
|
'lte' => [
|
|
'numeric' => ':attribute phải nhỏ hơn hoặc bằng :value.',
|
|
'file' => ':attribute phải nhỏ hơn hoặc bằng :value kilobytes.',
|
|
'string' => ':attribute phải có nhiều nhất :value ký tự.',
|
|
'array' => ':attribute không được có nhiều hơn :value phần tử.',
|
|
],
|
|
'max' => [
|
|
'numeric' => ':attribute không được lớn hơn :max.',
|
|
'file' => ':attribute không được lớn hơn :max kilobytes.',
|
|
'string' => ':attribute không được lớn hơn :max ký tự.',
|
|
'array' => ':attribute không được có nhiều hơn :max phần tử.',
|
|
],
|
|
'mimes' => ':attribute phải là một tập tin thuộc loại: :values.',
|
|
'mimetypes' => ':attribute phải là một tập tin thuộc loại: :values.',
|
|
'min' => [
|
|
'numeric' => ':attribute phải tối thiểu là :min.',
|
|
'file' => ':attribute phải tối thiểu :min kilobytes.',
|
|
'string' => ':attribute phải có tối thiểu :min ký tự.',
|
|
'array' => ':attribute phải có tối thiểu :min phần tử.',
|
|
],
|
|
'multiple_of' => ':attribute phải là bội số của :value',
|
|
'not_in' => ':attribute đã chọn không hợp lệ.',
|
|
'not_regex' => 'Định dạng :attribute không hợp lệ.',
|
|
'numeric' => ':attribute phải là một số.',
|
|
'password' => 'Mật khẩu không đúng.',
|
|
'present' => ':attribute phải có mặt.',
|
|
'regex' => 'Định dạng :attribute không hợp lệ.',
|
|
'required' => ':attribute là bắt buộc.',
|
|
'required_if' => ':attribute là bắt buộc khi :other là :value.',
|
|
'required_unless' => ':attribute là bắt buộc trừ khi :other là :values.',
|
|
'required_with' => ':attribute là bắt buộc khi có :values.',
|
|
'required_with_all' => ':attribute là bắt buộc khi có :values.',
|
|
'required_without' => ':attribute là bắt buộc khi không có :values.',
|
|
'required_without_all' => ':attribute là bắt buộc khi không có :values nào.',
|
|
'same' => ':attribute và :other phải giống nhau.',
|
|
'size' => [
|
|
'numeric' => ':attribute phải bằng :size.',
|
|
'file' => ':attribute phải bằng :size kilobytes.',
|
|
'string' => ':attribute phải có :size ký tự.',
|
|
'array' => ':attribute phải chứa :size phần tử.',
|
|
],
|
|
'starts_with' => ':attribute phải bắt đầu bằng một trong những giá trị sau: :values.',
|
|
'string' => ':attribute phải là một chuỗi.',
|
|
'timezone' => ':attribute phải là một múi giờ hợp lệ.',
|
|
'unique' => ':attribute đã tồn tại.',
|
|
'uploaded' => ':attribute tải lên thất bại.',
|
|
'url' => 'Định dạng :attribute không hợp lệ.',
|
|
'uuid' => ':attribute phải là một UUID hợp lệ.',
|
|
|
|
'custom' => [
|
|
'attribute-name' => [
|
|
'rule-name' => 'custom-message',
|
|
],
|
|
],
|
|
|
|
'attributes' => [],
|
|
|
|
'invalid_json' => 'Dữ liệu không hợp lệ. Vui lòng sửa và thử lại.',
|
|
'invalid_captcha' => 'Mã bảo vệ không đúng. Vui lòng nhập lại và thử lại.',
|
|
'complete_captcha' => 'Vui lòng nhập mã bảo vệ.',
|
|
];
|