国际化部分核心功能。
This commit is contained in:
@@ -10,6 +10,34 @@
|
||||
;!function(window, undefined){
|
||||
"use strict";
|
||||
|
||||
var messages;
|
||||
var lang = window.lang || "zh_CN";
|
||||
if (lang == 'en'){
|
||||
messages = {
|
||||
btnOk: 'Ok',
|
||||
btnCancel: 'Cancle',
|
||||
title: 'Information',
|
||||
promptTipA: 'Enter ',
|
||||
promptTipB: 'character at most.',
|
||||
noPicture: 'No picture',
|
||||
photoError: 'Current image address error.<br>Next slide?',
|
||||
photoNextPage: 'The next',
|
||||
photoClose: 'Close'
|
||||
};
|
||||
}else{
|
||||
messages = {
|
||||
btnOk: '确定',
|
||||
btnCancel: '取消',
|
||||
title: '信息',
|
||||
promptTipA: '最多输入',
|
||||
promptTipB: '个字符',
|
||||
noPicture: '没有图片',
|
||||
photoError: '当前图片地址异常<br>是否继续查看下一张?',
|
||||
photoNextPage: '下一张',
|
||||
photoClose: '不看了'
|
||||
};
|
||||
}
|
||||
|
||||
var isLayui = window.layui && layui.define, $, win, ready = {
|
||||
getPath: function(){
|
||||
var js = document.scripts, script = js[js.length - 1], jsPath = script.src;
|
||||
@@ -18,7 +46,7 @@ var isLayui = window.layui && layui.define, $, win, ready = {
|
||||
}(),
|
||||
|
||||
config: {}, end: {}, minIndex: 0, minLeft: [],
|
||||
btn: ['确定', '取消'],
|
||||
btn: [messages.btnOk, messages.btnCancel],
|
||||
|
||||
//五种原始层模式
|
||||
type: ['dialog', 'page', 'iframe', 'loading', 'tips']
|
||||
@@ -184,7 +212,7 @@ Class.pt.config = {
|
||||
shade: 0.3,
|
||||
fixed: true,
|
||||
move: doms[1],
|
||||
title: '信息',
|
||||
title: messages.title,
|
||||
offset: 'auto',
|
||||
area: 'auto',
|
||||
closeBtn: 1,
|
||||
@@ -994,7 +1022,7 @@ layer.prompt = function(options, yes){
|
||||
|
||||
return layer.open($.extend({
|
||||
type: 1
|
||||
,btn: ['确定','取消']
|
||||
,btn: [messages.btnOk,messages.btnCancel]
|
||||
,content: content
|
||||
,skin: 'layui-layer-prompt' + skin('prompt')
|
||||
,maxWidth: win.width()
|
||||
@@ -1009,7 +1037,7 @@ layer.prompt = function(options, yes){
|
||||
if(value === ''){
|
||||
prompt.focus();
|
||||
} else if(value.length > (options.maxlength||500)) {
|
||||
layer.tips('最多输入'+ (options.maxlength || 500) +'个字数', prompt, {tips: 1});
|
||||
layer.tips(messages.promptTipA + (options.maxlength || 500) + messages.promptTipB, prompt, {tips: 1});
|
||||
} else {
|
||||
yes && yes(value, index, prompt);
|
||||
}
|
||||
@@ -1116,7 +1144,7 @@ layer.photos = function(options, loop, key){
|
||||
if(!loop) return;
|
||||
|
||||
} else if (data.length === 0){
|
||||
return layer.msg('没有图片');
|
||||
return layer.msg(message.noPicture);
|
||||
}
|
||||
|
||||
//上一张
|
||||
@@ -1261,9 +1289,9 @@ layer.photos = function(options, loop, key){
|
||||
}, options));
|
||||
}, function(){
|
||||
layer.close(dict.loadi);
|
||||
layer.msg('当前图片地址异常<br>是否继续查看下一张?', {
|
||||
layer.msg(messages.photoError, {
|
||||
time: 30000,
|
||||
btn: ['下一张', '不看了'],
|
||||
btn: [messages.photoNextPage, messages.photoClose],
|
||||
yes: function(){
|
||||
data.length > 1 && dict.imgnext(true,true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user