From 0ba655692c50ccf2842d841ef66a62a3da4ec31d Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Wed, 28 May 2025 10:47:01 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BF=AE=E6=94=B9=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=E5=99=A8=E8=AF=AD=E8=A8=80=E5=8C=85=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/lang/en-us/mobile.php | 21 ------------ app/index/lang/en-us/validate.php | 11 +++++++ .../validate/ContactUsMessageValidate.php | 14 ++++---- app/index/validate/ProductInquiryValidate.php | 32 +++++++++---------- 4 files changed, 34 insertions(+), 44 deletions(-) diff --git a/app/index/lang/en-us/mobile.php b/app/index/lang/en-us/mobile.php index dd3db626..9caf1bbc 100644 --- a/app/index/lang/en-us/mobile.php +++ b/app/index/lang/en-us/mobile.php @@ -35,27 +35,6 @@ return [ '信息已成功提交!' => 'Add Success!', '信息提交失败!' => 'Add Fail!', - // 验证器中文本 - 'validate_first_name_require' => '名不能为空', - 'validate_first_name_max' => '名不能超过64个字符', - 'validate_last_name_require' => '姓不能为空', - 'validate_last_name_max' => '姓不能超过64个字符', - 'validate_email_require' => '邮箱不能为空', - 'validate_email_email' => '邮箱格式不正确', - 'validate_email_max' => '邮箱不能超过128个字符', - 'validate_phone_max' => '电话号码不能超过32个字符', - 'validate_country_name_require' => '国家不能为空', - 'validate_country_name_max' => '国家不能超过128个字符', - 'validate_corp_name_require' => '公司/组织不能为空', - 'validate_corp_name_max' => '公司/组织不能超过128个字符', - 'validate_industry_require' => '行业不能为空', - 'validate_industry_max' => '行业不能超过64个字符', - 'validate_message_require' => '询问内容不能为空', - 'validate_message_max' => '询问内容不能超过1024个字符', - // 返回文本 - 'send_success' => '信息已成功提交', - 'send_fail' => '信息提交失败', - // 附件下载 '软件下载' => 'Software download', '支持型号' => 'Supported Models', diff --git a/app/index/lang/en-us/validate.php b/app/index/lang/en-us/validate.php index 9b5f1139..2a47a3a4 100644 --- a/app/index/lang/en-us/validate.php +++ b/app/index/lang/en-us/validate.php @@ -25,4 +25,15 @@ return [ '感兴趣的产品种类不能超过255个字符' => 'Interested product categories cannot exceed 255 characters', '留言内容不能为空' => 'Message content is required', '留言内容不能超过1024个字符' => 'Message content cannot exceed 1024 characters', + '姓名不能为空' => 'Name is required', + '问题不能为空' => 'Question is required', + '问题不能超过1024个字符' => 'Question cannot exceed 1024 characters', + '国家不能为空' => 'Country is required', + '国家不能超过128个字符' => 'Country cannot exceed 128 characters', + '公司/组织不能为空' => 'Company/Organization is required', + '公司/组织不能超过128个字符' => 'Company/Organization cannot exceed 128 characters', + '行业不能为空' => 'Industry is required', + '行业不能超过64个字符' => 'Industry cannot exceed 64 characters', + '询问内容不能为空' => 'Inquiry is required', + '询问内容不能超过1024个字符' => 'Inquiry cannot exceed 1024 characters', ]; \ No newline at end of file diff --git a/app/index/validate/ContactUsMessageValidate.php b/app/index/validate/ContactUsMessageValidate.php index 87fac7e8..738f6d8d 100644 --- a/app/index/validate/ContactUsMessageValidate.php +++ b/app/index/validate/ContactUsMessageValidate.php @@ -26,12 +26,12 @@ class ContactUsMessageValidate extends Validate * @var array */ protected $message = [ - 'name.require' => 'contact_message.validate_name_required', - 'name.max' => 'contact_message.validate_name_max', - 'email.require' => 'contact_message.validate_email_required', - 'email.email' => 'contact_message.validate_email_email', - 'email.max' => 'contact_message.validate_email_max', - 'content.require' => 'contact_message.validate_content_required', - 'content.max' => 'contact_message.validate_content_max' + 'name.require' => '姓名不能为空', + 'name.max' => '姓名不能超过64个字符', + 'email.require' => '邮箱不能为空', + 'email.email' => '邮箱格式不正确', + 'email.max' => '邮箱不能超过128个字符', + 'content.require' => '问题不能为空', + 'content.max' => '问题不能超过1024个字符' ]; } diff --git a/app/index/validate/ProductInquiryValidate.php b/app/index/validate/ProductInquiryValidate.php index 0613fbd8..c696fea9 100644 --- a/app/index/validate/ProductInquiryValidate.php +++ b/app/index/validate/ProductInquiryValidate.php @@ -31,21 +31,21 @@ class ProductInquiryValidate extends Validate * @var array */ protected $message = [ - 'first_name.require' => 'validate_first_name_require', - 'first_name.max' => 'validate_first_name_max', - 'last_name.require' => 'validate_last_name_require', - 'last_name.max' => 'validate_last_name_max', - 'email.require' => 'validate_email_require', - 'email.email' => 'validate_email_email', - 'email.max' => 'validate_email_max', - 'phone.max' => 'validate_phone_max', - 'country_name.require' => 'validate_country_name_require', - 'country_name.max' => 'validate_country_name_max', - 'corp_name.require' => 'validate_corp_name_require', - 'corp_name.max' => 'validate_corp_name_max', - 'industry.require' => 'validate_industry_require', - 'industry.max' => 'validate_industry_max', - 'message.require' => 'validate_message_require', - 'message.max' => 'validate_message_max' + 'first_name.require' => '名不能为空', + 'first_name.max' => '名不能超过64个字符', + 'last_name.require' => '姓不能为空', + 'last_name.max' => '姓不能超过64个字符', + 'email.require' => '邮箱不能为空', + 'email.email' => '邮箱格式不正确', + 'email.max' => '邮箱不能超过128个字符', + 'phone.max' => '电话号码不能超过32个字符', + 'country_name.require' => '国家不能为空', + 'country_name.max' => '国家不能超过128个字符', + 'corp_name.require' => '公司/组织不能为空', + 'corp_name.max' => '公司/组织不能超过128个字符', + 'industry.require' => '行业不能为空', + 'industry.max' => '行业不能超过64个字符', + 'message.require' => '询问内容不能为空', + 'message.max' => '询问内容不能超过1024个字符' ]; }