英文提示:
最终效果:
备注: 可省略前4步,直接看第5步解决方法;
解决过程
1. 刚开始搜索,“fastadmin多语言如何默认为中文”,答案如下:
按照上图设置后无效;
2. 然后查到需要将public\assets\libs\plupload\js\i18n\zh_CN.js的内容放置在public\assets\js\require-upload.js
当在配置文件config.php中开始调试模式时,有效果;
但是
当关闭调试模式时,失效;
'app_debug' => Env::get('app.debug', false),
3. 继而找出官方回复的链接:生产环境失效;
4. 根据回答,引出命令号一键打包文档,在本地安装过node环境,并顺利压缩好js后,结果,仍旧无效(气到爆)!!
5. 在几乎灰心的时刻,搜了下“fastadmin框架修改js无效”,在众多网页中看到一条,需要手动更改require-backend.min.js;
在require-backend.min.js文件中找到require-upload.js的内容,添加一行内容,如下图:
//新增zh_CN.js内容
Plupload.addI18n({"Stop Upload":"停止上传","Upload URL might be wrong or doesn't exist.":"上传的URL可能是错误的或不存在。","tb":"tb","Size":"大小","Close":"关闭","You must specify either browse_button or drop_element.":"您必须指定 browse_button 或者 drop_element。","Init error.":"初始化错误。","Add files to the upload queue and click the start button.":"将文件添加到上传队列,然后点击”开始上传“按钮。","List":"列表","Filename":"文件名","%s specified, but cannot be found.":"%s 已指定,但是没有找到。","Image format either wrong or not supported.":"图片格式错误或者不支持。","Status":"状态","HTTP Error.":"HTTP 错误。","Start Upload":"开始上传","Error: File too large:":"错误: 文件太大:","kb":"kb","Duplicate file error.":"重复文件错误。","File size error.":"文件大小错误。","N/A":"N/A","gb":"gb","Error: Invalid file extension:":"错误:无效的文件扩展名:","Select files":"选择文件","%s already present in the queue.":"%s 已经在当前队列里。","Resoultion out of boundaries! <b>%s</b> runtime supports images only up to %wx%hpx.":"超限。<b>%s</b> 支持最大 %wx%hpx 的图片。","File: %s":"文件: %s","b":"b","Uploaded %d/%d files":"已上传 %d/%d 个文件","Upload element accepts only %d file(s) at a time. Extra files were stripped.":"每次只接受同时上传 %d 个文件,多余的文件将会被删除。","%d files queued":"%d 个文件加入到队列","File: %s, size: %d, max file size: %d":"文件: %s, 大小: %d, 最大文件大小: %d","Thumbnails":"缩略图","Drag files here.":"把文件拖到这里。","Runtime ran out of available memory.":"运行时已消耗所有可用内存。","File count error.":"文件数量错误。","File extension error.":"文件扩展名错误。","mb":"mb","Add Files":"增加文件"});
var Upload = {
list: {},
config: {
container: document.body,
classname: '.plupload:not([initialized])',
previewtpl: '<li class="col-xs-3"><a href="<%=fullurl%>" data-url="<%=url%>" target="_blank" class="thumbnail"><img src="<%=fullurl%>" onerror="this.src=\'https://tool.fastadmin.net/icon/\'+\'<%=fullurl%>\'.split(\'.\').pop()+\'.png\';this.onerror=null;" class="img-responsive"></a><a href="javascript:;" class="btn btn-danger btn-xs btn-trash"><i class="fa fa-trash"></i></a></li>',
},
}
注: Plupload首字母为大写;
最终成功