jqh 5 роки тому
батько
коміт
cc90a2f5f4
3 змінених файлів з 56 додано та 56 видалено
  1. 27 25
      resources/lang/en/admin.php
  2. 27 25
      resources/lang/zh-CN/admin.php
  3. 2 6
      src/Form/Field/Text.php

+ 27 - 25
resources/lang/en/admin.php

@@ -154,38 +154,40 @@ return [
         'filter_clear'       => 'Show all',
         'filter_placeholder' => 'Filter',
     ],
-    'responsive'            => [
-        'display'               => '  ',
-        'display_all'           => ' <i class="glyphicon glyphicon-th icon-th"></i> ',
-        'focus'                 => 'Focus',
+    'responsive' => [
+        'display'     => '  ',
+        'display_all' => ' <i class="glyphicon glyphicon-th icon-th"></i> ',
+        'focus'       => 'Focus',
     ],
     'uploader' => [
-        'add_new_media' => 'Browse',
-        'drag_file' => 'Or drag file here',
-        'max_file_limit' => 'The :attribute may not be greater than :max.',
-        'exceed_size' => 'Exceeds the maximum file-size',
-        'interrupt' => 'Interrupt',
-        'upload_failed' => 'Upload failed! Please try again.',
-        'selected_files' => ':num files selected,size: :size。',
-        'selected_has_failed' => 'Uploaded: :success, failed: :fail, <a class="retry"  href="javascript:"";">retry</a>or<a class="ignore" href="javascript:"";">ignore</a>',
-        'selected_success' => ':num(:size) files selected, Uploaded: :success.',
-        'dot' => ', ',
-        'failed_num' => 'failed::fail.',
-        'pause_upload' => 'Pause',
-        'go_on_upload' => 'Go On',
-        'start_upload' => 'Upload',
+        'add_new_media'          => 'Browse',
+        'drag_file'              => 'Or drag file here',
+        'max_file_limit'         => 'The :attribute may not be greater than :max.',
+        'exceed_size'            => 'Exceeds the maximum file-size',
+        'interrupt'              => 'Interrupt',
+        'upload_failed'          => 'Upload failed! Please try again.',
+        'selected_files'         => ':num files selected,size: :size。',
+        'selected_has_failed'    => 'Uploaded: :success, failed: :fail, <a class="retry"  href="javascript:"";">retry</a>or<a class="ignore" href="javascript:"";">ignore</a>',
+        'selected_success'       => ':num(:size) files selected, Uploaded: :success.',
+        'dot'                    => ', ',
+        'failed_num'             => 'failed::fail.',
+        'pause_upload'           => 'Pause',
+        'go_on_upload'           => 'Go On',
+        'start_upload'           => 'Upload',
         'upload_success_message' => ':success files uploaded successfully',
-        'go_on_add' => 'New File',
-        'Q_TYPE_DENIED' => 'Sorry, the type of this file is not allowed!',
-        'Q_EXCEED_NUM_LIMIT' => 'Sorry, maximum number of allowable file uploads has been exceeded!',
-        'F_EXCEED_SIZE' => 'Sorry,the maximum file-size has been exceeded!',
-        'Q_EXCEED_SIZE_LIMIT' => 'Sorry, the maximum file-size has been exceeded!',
-        'F_DUPLICATE' => 'Duplicate file.',
+        'go_on_add'              => 'New File',
+        'Q_TYPE_DENIED'          => 'Sorry, the type of this file is not allowed!',
+        'Q_EXCEED_NUM_LIMIT'     => 'Sorry, maximum number of allowable file uploads has been exceeded!',
+        'F_EXCEED_SIZE'          => 'Sorry,the maximum file-size has been exceeded!',
+        'Q_EXCEED_SIZE_LIMIT'    => 'Sorry, the maximum file-size has been exceeded!',
+        'F_DUPLICATE'            => 'Duplicate file.',
     ],
     'import_extension_confirm' => 'Are you sure import the extension?',
     'selected_must_less_then'  => 'Only supports maximum :num options.',
     'validation' => [
-        'match' => 'Does not match with :attribute.',
+        'match'     => 'Does not match with :attribute.',
+        'minlength' => 'The :attribute must be at least :min characters.',
+        'maxlength' => 'The :attribute may not be greater than :max characters.',
     ],
     'menu_titles' => [],
 ];

+ 27 - 25
resources/lang/zh-CN/admin.php

@@ -155,38 +155,40 @@ return [
         'filter_clear'       => '显示全部',
         'filter_placeholder' => '过滤',
     ],
-    'responsive'            => [
-        'display'               => '  ',
-        'display_all'           => ' <i class="glyphicon glyphicon-th icon-th"></i> ',
-        'focus'                 => '聚焦',
+    'responsive'      => [
+        'display'     => '  ',
+        'display_all' => ' <i class="glyphicon glyphicon-th icon-th"></i> ',
+        'focus'       => '聚焦',
     ],
     'uploader' => [
-        'add_new_media' => '添加文件',
-        'drag_file' => '或将文件拖到这里',
-        'max_file_limit' => 'The :attribute may not be greater than :max.',
-        'exceed_size' => '文件大小超出',
-        'interrupt' => '上传暂停',
-        'upload_failed' => '上传失败,请重试',
-        'selected_files' => '选中:num个文件,共:size。',
-        'selected_has_failed' => '已成功上传:success个文件,:fail个文件上传失败,<a class="retry"  href="javascript:"";">重新上传</a>失败文件或<a class="ignore" href="javascript:"";">忽略</a>',
-        'selected_success' => '共:num个(:size),已上传:success个。',
-        'dot' => ',',
-        'failed_num' => '失败:fail个。',
-        'pause_upload' => '暂停上传',
-        'go_on_upload' => '继续上传',
-        'start_upload' => '开始上传',
+        'add_new_media'          => '添加文件',
+        'drag_file'              => '或将文件拖到这里',
+        'max_file_limit'         => 'The :attribute may not be greater than :max.',
+        'exceed_size'            => '文件大小超出',
+        'interrupt'              => '上传暂停',
+        'upload_failed'          => '上传失败,请重试',
+        'selected_files'         => '选中:num个文件,共:size。',
+        'selected_has_failed'    => '已成功上传:success个文件,:fail个文件上传失败,<a class="retry"  href="javascript:"";">重新上传</a>失败文件或<a class="ignore" href="javascript:"";">忽略</a>',
+        'selected_success'       => '共:num个(:size),已上传:success个。',
+        'dot' =>                 ',',
+        'failed_num'             => '失败:fail个。',
+        'pause_upload'           => '暂停上传',
+        'go_on_upload'           => '继续上传',
+        'start_upload'           => '开始上传',
         'upload_success_message' => '已成功上传:success个文件',
-        'go_on_add' => '继续添加',
-        'Q_TYPE_DENIED' => '对不起,不允许上传此类型文件',
-        'Q_EXCEED_NUM_LIMIT' => '对不起,已超出文件上传数量限制,最多只能上传:num个文件',
-        'F_EXCEED_SIZE' => '对不起,当前选择的文件过大',
-        'Q_EXCEED_SIZE_LIMIT' => '对不起,已超出文件大小限制',
-        'F_DUPLICATE' => '文件重复',
+        'go_on_add'              => '继续添加',
+        'Q_TYPE_DENIED'          => '对不起,不允许上传此类型文件',
+        'Q_EXCEED_NUM_LIMIT'     => '对不起,已超出文件上传数量限制,最多只能上传:num个文件',
+        'F_EXCEED_SIZE'          => '对不起,当前选择的文件过大',
+        'Q_EXCEED_SIZE_LIMIT'    => '对不起,已超出文件大小限制',
+        'F_DUPLICATE'            => '文件重复',
     ],
     'import_extension_confirm' => '确认导入拓展?',
     'selected_must_less_then'  => '最多只能选择:num个选项',
     'validation' => [
-        'match' => '与 :attribute 不匹配。',
+        'match'     => '与 :attribute 不匹配。',
+        'minlength' => ':attribute 字符长度不能小于 :min。',
+        'maxlength' => ':attribute 字符长度不能大于 :max。',
     ],
     'menu_titles' => [],
 ];

+ 2 - 6
src/Form/Field/Text.php

@@ -81,14 +81,12 @@ class Text extends Field
     {
         $this->rules('min:'.$length);
 
-        $defaultError = trans('validation.min.string') ?: 'The :attribute may not be greater than :max characters.';
-
         return $this->attribute([
             'data-minlength'       => $length,
             'data-minlength-error' => str_replace(
                 [':attribute', ':min'],
                 [$this->column, $length],
-                $error ?: $defaultError
+                $error ?: trans('admin.validation.minlength')
             ),
         ]);
     }
@@ -111,14 +109,12 @@ JS
 
         $this->rules('max:'.$length);
 
-        $defaultError = trans('validation.max.string') ?: 'The :attribute may not be greater than :max characters.';
-
         return $this->attribute([
             'data-maxlength'       => $length,
             'data-maxlength-error' => str_replace(
                 [':attribute', ':max'],
                 [$this->column, $length],
-                $error ?: $defaultError
+                $error ?: trans('admin.validation.maxlength')
             ),
         ]);
     }