wip(i18n): 改进 upload i18n key

pull/2695/head
sight 2025-05-24 19:25:38 +08:00
parent 0e1283442d
commit cc222d9d22
2 changed files with 5 additions and 5 deletions

View File

@ -171,7 +171,7 @@
video: '视频',
audio: '音频'
},
prompt: {
validateMessages: {
fileExtensionError: '选择的{fileType}中包含不支持的格式',
filesOverLengthLimit: '同时最多只能上传: {length} 个文件',
currentFilesLength: '您当前已经选择了: {length} 个文件',

View File

@ -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})
+ '<br/>'
+ 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();