From cc222d9d2256272daabda128ede1d843b3689d0c Mon Sep 17 00:00:00 2001 From: sight <26325820+Sight-wcg@users.noreply.github.com> Date: Sat, 24 May 2025 19:25:38 +0800 Subject: [PATCH] =?UTF-8?q?wip(i18n):=20=E6=94=B9=E8=BF=9B=20upload=20i18n?= =?UTF-8?q?=20key?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layui.js | 2 +- src/modules/upload.js | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/layui.js b/src/layui.js index 8afff3e5..9108e13e 100644 --- a/src/layui.js +++ b/src/layui.js @@ -171,7 +171,7 @@ video: '视频', audio: '音频' }, - prompt: { + validateMessages: { fileExtensionError: '选择的{fileType}中包含不支持的格式', filesOverLengthLimit: '同时最多只能上传: {length} 个文件', currentFilesLength: '您当前已经选择了: {length} 个文件', diff --git a/src/modules/upload.js b/src/modules/upload.js index a7fcc41d..0f49b21c 100644 --- a/src/modules/upload.js +++ b/src/modules/upload.js @@ -572,7 +572,7 @@ layui.define(['lay', 'layer'], function(exports) { // 校验失败提示 if(check){ - that.msg(text['check-error'] || layui.$t('lay.upload.prompt.fileExtensionError', {fileType: typeName})); + that.msg(text['check-error'] || layui.$t('lay.upload.validateMessages.fileExtensionError', {fileType: typeName})); return elemFile.value = ''; } @@ -598,9 +598,9 @@ layui.define(['lay', 'layer'], function(exports) { return that.msg(typeof text['limit-number'] === 'function' ? text['limit-number'](options, that.fileLength) : ( - layui.$t('lay.upload.prompt.filesOverLengthLimit', {length: options.number}) + layui.$t('lay.upload.validateMessages.filesOverLengthLimit', {length: options.number}) + '
' - + layui.$t('lay.upload.prompt.currentFilesLength', {length: that.fileLength}) + + layui.$t('lay.upload.validateMessages.currentFilesLength', {length: that.fileLength}) )); } @@ -619,7 +619,7 @@ layui.define(['lay', 'layer'], function(exports) { if(limitSize) return that.msg( typeof text['limit-size'] === 'function' ? text['limit-size'](options, limitSize) - : layui.$t('lay.upload.prompt.fileOverSizeLimit', {size: limitSize})); + : layui.$t('lay.upload.validateMessages.fileOverSizeLimit', {size: limitSize})); } send();