Bladeren bron

国际化

xuxueli 8 jaren geleden
bovenliggende
commit
d24b7a308f

+ 9 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/controller/interceptor/CookieInterceptor.java Bestand weergeven

1
 package com.xxl.job.admin.controller.interceptor;
1
 package com.xxl.job.admin.controller.interceptor;
2
 
2
 
3
+import com.xxl.job.admin.core.util.FtlUtil;
4
+import com.xxl.job.admin.core.util.I18nUtil;
3
 import org.apache.commons.lang3.ArrayUtils;
5
 import org.apache.commons.lang3.ArrayUtils;
4
 import org.springframework.web.servlet.ModelAndView;
6
 import org.springframework.web.servlet.ModelAndView;
5
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
7
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
19
 	@Override
21
 	@Override
20
 	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
22
 	public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
21
 			ModelAndView modelAndView) throws Exception {
23
 			ModelAndView modelAndView) throws Exception {
22
-		
24
+
25
+		// cookie
23
 		if (modelAndView!=null && ArrayUtils.isNotEmpty(request.getCookies())) {
26
 		if (modelAndView!=null && ArrayUtils.isNotEmpty(request.getCookies())) {
24
 			HashMap<String, Cookie> cookieMap = new HashMap<String, Cookie>();
27
 			HashMap<String, Cookie> cookieMap = new HashMap<String, Cookie>();
25
 			for (Cookie ck : request.getCookies()) {
28
 			for (Cookie ck : request.getCookies()) {
27
 			}
30
 			}
28
 			modelAndView.addObject("cookieMap", cookieMap);
31
 			modelAndView.addObject("cookieMap", cookieMap);
29
 		}
32
 		}
33
+
34
+		// static method
35
+		if (modelAndView != null) {
36
+			modelAndView.addObject("I18nUtil", FtlUtil.generateStaticModel(I18nUtil.class.getName()));
37
+		}
30
 		
38
 		
31
 		super.postHandle(request, response, handler, modelAndView);
39
 		super.postHandle(request, response, handler, modelAndView);
32
 	}
40
 	}

+ 25 - 0
xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/FtlUtil.java Bestand weergeven

1
+package com.xxl.job.admin.core.util;
2
+
3
+import freemarker.ext.beans.BeansWrapper;
4
+import freemarker.template.TemplateHashModel;
5
+
6
+/**
7
+ * ftl util
8
+ *
9
+ * @author xuxueli 2018-01-17 20:37:48
10
+ */
11
+public class FtlUtil {
12
+
13
+    public static TemplateHashModel generateStaticModel(String packageName) {
14
+        try {
15
+            BeansWrapper wrapper = BeansWrapper.getDefaultInstance();
16
+            TemplateHashModel staticModels = wrapper.getStaticModels();
17
+            TemplateHashModel fileStatics = (TemplateHashModel) staticModels.get(packageName);
18
+            return fileStatics;
19
+        } catch (Exception e) {
20
+            e.printStackTrace();
21
+        }
22
+        return null;
23
+    }
24
+
25
+}

+ 7 - 1
xxl-job-admin/src/main/java/com/xxl/job/admin/core/util/I18nUtil.java Bestand weergeven

10
 import java.io.IOException;
10
 import java.io.IOException;
11
 import java.util.Properties;
11
 import java.util.Properties;
12
 
12
 
13
+/**
14
+ * i18n util
15
+ *
16
+ * @author xuxueli 2018-01-17 20:39:06
17
+ */
13
 public class I18nUtil {
18
 public class I18nUtil {
14
     private static Logger logger = LoggerFactory.getLogger(I18nUtil.class);
19
     private static Logger logger = LoggerFactory.getLogger(I18nUtil.class);
15
 
20
 
16
     private static final String i18n_file = "i18n/message.properties";
21
     private static final String i18n_file = "i18n/message.properties";
17
     private static Properties prop = null;
22
     private static Properties prop = null;
23
+    private static boolean prop_cache = false;
18
 
24
 
19
     public static Properties loadI18nProp(){
25
     public static Properties loadI18nProp(){
20
-        if (prop == null) {
26
+        if (prop_cache && prop == null) {
21
             try {
27
             try {
22
                 Resource resource = new ClassPathResource(i18n_file);
28
                 Resource resource = new ClassPathResource(i18n_file);
23
                 EncodedResource encodedResource = new EncodedResource(resource,"UTF-8");
29
                 EncodedResource encodedResource = new EncodedResource(resource,"UTF-8");

+ 21 - 1
xxl-job-admin/src/main/resources/i18n/message.properties Bestand weergeven

1
-admin_name=任务调度中心
1
+admin_name=任务调度中心
2
+
3
+login_btn=登录
4
+login_remember_me=记住密码
5
+login_username_placeholder=请输入登录账号
6
+login_password_placeholder=请输入登录密码
7
+login_username_empty=请输入登录账号
8
+login_username_lt_5=登录账号不应低于5位
9
+login_password_empty=请输入登录密码
10
+login_password_lt_5=登录密码不应低于5位
11
+login_success=登录成功
12
+login_fail=登录失败
13
+
14
+logout_btn=注销
15
+logout_confirm=确认注销登录?
16
+logout_success=注销成功
17
+logout_fail=注销失败
18
+
19
+system_tips=系统提示
20
+system_ok=确定2
21
+system_close=关闭2

+ 6 - 0
xxl-job-admin/src/main/resources/i18n/message_en.properties Bestand weergeven

1
+admin_name=Job Scheduling Center 
2
+
3
+login_btn=Login
4
+login_remember_me=Remember Me
5
+login_username_placeholder=Please input username
6
+login_password_placeholder=Please input password

+ 6 - 0
xxl-job-admin/src/main/resources/i18n/message_zh.properties Bestand weergeven

1
+admin_name=任务调度中心
2
+
3
+login_btn=登录
4
+login_remember_me=记住密码
5
+login_username_placeholder=请输入登录账号
6
+login_password_placeholder=请输入登录密码

+ 14 - 4
xxl-job-admin/src/main/webapp/WEB-INF/template/common/common.macro.ftl Bestand weergeven

53
 
53
 
54
 	<#-- common -->
54
 	<#-- common -->
55
     <script src="${request.contextPath}/static/js/common.1.js"></script>
55
     <script src="${request.contextPath}/static/js/common.1.js"></script>
56
-    <script>var base_url = '${request.contextPath}';</script>
56
+    <script>
57
+		var base_url = '${request.contextPath}';
58
+
59
+		var system_tips = '${I18nUtil.getString("system_tips")}';
60
+        var system_ok = '${I18nUtil.getString("system_ok")}';
61
+        var system_close = '${I18nUtil.getString("system_close")}';
62
+
63
+        var logout_confirm = '${I18nUtil.getString("logout_confirm")}';
64
+        var logout_success = '${I18nUtil.getString("logout_success")}';
65
+        var logout_fail = '${I18nUtil.getString("logout_fail")}';
66
+	</script>
57
 
67
 
58
 </#macro>
68
 </#macro>
59
 
69
 
61
 	<header class="main-header">
71
 	<header class="main-header">
62
 		<a href="${request.contextPath}/" class="logo">
72
 		<a href="${request.contextPath}/" class="logo">
63
 			<span class="logo-mini"><b>XXL</b></span>
73
 			<span class="logo-mini"><b>XXL</b></span>
64
-			<span class="logo-lg"><b>任务调度中心</b></span>
74
+			<span class="logo-lg"><b>${I18nUtil.getString("admin_name")}</b></span>
65
 		</a>
75
 		</a>
66
 		<nav class="navbar navbar-static-top" role="navigation">
76
 		<nav class="navbar navbar-static-top" role="navigation">
67
 			<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"><span class="sr-only">切换导航</span></a>
77
 			<a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button"><span class="sr-only">切换导航</span></a>
69
 				<ul class="nav navbar-nav">
79
 				<ul class="nav navbar-nav">
70
 					<li class="dropdown user user-menu">
80
 					<li class="dropdown user user-menu">
71
 	                    <a href=";" id="logoutBtn" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
81
 	                    <a href=";" id="logoutBtn" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
72
-                      		<span class="hidden-xs">注销</span>
82
+                      		<span class="hidden-xs">${I18nUtil.getString("logout_btn")}</span>
73
 	                    </a>
83
 	                    </a>
74
 					</li>
84
 					</li>
75
 				</ul>
85
 				</ul>
175
 
185
 
176
 <#macro commonFooter >
186
 <#macro commonFooter >
177
 	<footer class="main-footer">
187
 	<footer class="main-footer">
178
-        Powered by <b>XXL-JOB</b> 1.9.1(快照版本
188
+        Powered by <b>XXL-JOB</b> 1.9.1(SNAPSHOT
179
 		<div class="pull-right hidden-xs">
189
 		<div class="pull-right hidden-xs">
180
             <strong>Copyright &copy; 2015-${.now?string('yyyy')} &nbsp;
190
             <strong>Copyright &copy; 2015-${.now?string('yyyy')} &nbsp;
181
                 <a href="http://www.xuxueli.com/" target="_blank" >xuxueli</a>
191
                 <a href="http://www.xuxueli.com/" target="_blank" >xuxueli</a>

+ 2 - 2
xxl-job-admin/src/main/webapp/WEB-INF/template/help.ftl Bestand weergeven

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
3
 <head>
4
-  	<title>任务调度中心</title>
4
+    <title>${I18nUtil.getString("admin_name")}</title>
5
   	<#import "/common/common.macro.ftl" as netCommon>
5
   	<#import "/common/common.macro.ftl" as netCommon>
6
 	<@netCommon.commonStyle />
6
 	<@netCommon.commonStyle />
7
 </head>
7
 </head>
16
 	<div class="content-wrapper">
16
 	<div class="content-wrapper">
17
 		<!-- Content Header (Page header) -->
17
 		<!-- Content Header (Page header) -->
18
 		<section class="content-header">
18
 		<section class="content-header">
19
-			<h1>使用教程<small>任务调度中心</small></h1>
19
+			<h1>使用教程</h1>
20
 			<!--
20
 			<!--
21
 			<ol class="breadcrumb">
21
 			<ol class="breadcrumb">
22
 				<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>
22
 				<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>

+ 3 - 2
xxl-job-admin/src/main/webapp/WEB-INF/template/index.ftl Bestand weergeven

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
3
 <head>
4
-  	<title>任务调度中心</title>
4
+    <title>${I18nUtil.getString("admin_name")}</title>
5
   	<#import "/common/common.macro.ftl" as netCommon>
5
   	<#import "/common/common.macro.ftl" as netCommon>
6
 	<@netCommon.commonStyle />
6
 	<@netCommon.commonStyle />
7
     <!-- daterangepicker -->
7
     <!-- daterangepicker -->
18
 	<div class="content-wrapper">
18
 	<div class="content-wrapper">
19
 		<!-- Content Header (Page header) -->
19
 		<!-- Content Header (Page header) -->
20
 		<section class="content-header">
20
 		<section class="content-header">
21
-			<h1>运行报表<small>任务调度中心</small></h1>
21
+			<h1>运行报表</h1>
22
 			<!--
22
 			<!--
23
+			<h1>运行报表<small>任务调度中心</small></h1>
23
 			<ol class="breadcrumb">
24
 			<ol class="breadcrumb">
24
 				<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>
25
 				<li><a><i class="fa fa-dashboard"></i>调度中心</a></li>
25
 				<li class="active">使用教程</li>
26
 				<li class="active">使用教程</li>

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/jobcode/jobcode.index.ftl Bestand weergeven

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
3
 <head>
4
-  	<title>任务调度中心</title>
4
+    <title>${I18nUtil.getString("admin_name")}</title>
5
   	<#import "/common/common.macro.ftl" as netCommon>
5
   	<#import "/common/common.macro.ftl" as netCommon>
6
 	<@netCommon.commonStyle />
6
 	<@netCommon.commonStyle />
7
 	<link rel="stylesheet" href="${request.contextPath}/static/plugins/codemirror/lib/codemirror.css">
7
 	<link rel="stylesheet" href="${request.contextPath}/static/plugins/codemirror/lib/codemirror.css">

+ 2 - 2
xxl-job-admin/src/main/webapp/WEB-INF/template/jobgroup/jobgroup.index.ftl Bestand weergeven

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
3
 <head>
4
-  	<title>任务调度中心</title>
4
+    <title>${I18nUtil.getString("admin_name")}</title>
5
   	<#import "/common/common.macro.ftl" as netCommon>
5
   	<#import "/common/common.macro.ftl" as netCommon>
6
 	<@netCommon.commonStyle />
6
 	<@netCommon.commonStyle />
7
 	<!-- DataTables -->
7
 	<!-- DataTables -->
18
 	<div class="content-wrapper">
18
 	<div class="content-wrapper">
19
 		<!-- Content Header (Page header) -->
19
 		<!-- Content Header (Page header) -->
20
 		<section class="content-header">
20
 		<section class="content-header">
21
-			<h1>执行器管理<small>任务调度中心</small></h1>
21
+			<h1>执行器管理</h1>
22
 		</section>
22
 		</section>
23
 
23
 
24
 		<!-- Main content -->
24
 		<!-- Main content -->

+ 2 - 2
xxl-job-admin/src/main/webapp/WEB-INF/template/jobinfo/jobinfo.index.ftl Bestand weergeven

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
3
 <head>
4
-  	<title>任务调度中心</title>
4
+    <title>${I18nUtil.getString("admin_name")}</title>
5
   	<#import "/common/common.macro.ftl" as netCommon>
5
   	<#import "/common/common.macro.ftl" as netCommon>
6
 	<@netCommon.commonStyle />
6
 	<@netCommon.commonStyle />
7
 	<!-- DataTables -->
7
 	<!-- DataTables -->
19
 	<div class="content-wrapper">
19
 	<div class="content-wrapper">
20
 		<!-- Content Header (Page header) -->
20
 		<!-- Content Header (Page header) -->
21
 		<section class="content-header">
21
 		<section class="content-header">
22
-			<h1>任务管理<small>任务调度中心</small></h1>
22
+			<h1>任务管理</h1>
23
 			<!--
23
 			<!--
24
 			<ol class="breadcrumb">
24
 			<ol class="breadcrumb">
25
 				<li><a><i class="fa fa-dashboard"></i>调度管理</a></li>
25
 				<li><a><i class="fa fa-dashboard"></i>调度管理</a></li>

+ 1 - 1
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.detail.ftl Bestand weergeven

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
3
 <head>
4
-    <title>任务调度中心</title>
4
+    <title>${I18nUtil.getString("admin_name")}</title>
5
 <#import "/common/common.macro.ftl" as netCommon>
5
 <#import "/common/common.macro.ftl" as netCommon>
6
 <@netCommon.commonStyle />
6
 <@netCommon.commonStyle />
7
 </head>
7
 </head>

+ 2 - 2
xxl-job-admin/src/main/webapp/WEB-INF/template/joblog/joblog.index.ftl Bestand weergeven

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
3
 <head>
4
-  	<title>任务调度中心</title>
4
+    <title>${I18nUtil.getString("admin_name")}</title>
5
   	<#import "/common/common.macro.ftl" as netCommon>
5
   	<#import "/common/common.macro.ftl" as netCommon>
6
 	<@netCommon.commonStyle />
6
 	<@netCommon.commonStyle />
7
 	<!-- DataTables -->
7
 	<!-- DataTables -->
20
 	<div class="content-wrapper">
20
 	<div class="content-wrapper">
21
 		<!-- Content Header (Page header) -->
21
 		<!-- Content Header (Page header) -->
22
 		<section class="content-header">
22
 		<section class="content-header">
23
-			<h1>调度日志<small>任务调度中心</small></h1>
23
+			<h1>调度日志</h1>
24
 			<!--
24
 			<!--
25
 			<ol class="breadcrumb">
25
 			<ol class="breadcrumb">
26
 				<li><a><i class="fa fa-dashboard"></i>调度日志</a></li>
26
 				<li><a><i class="fa fa-dashboard"></i>调度日志</a></li>

+ 18 - 6
xxl-job-admin/src/main/webapp/WEB-INF/template/login.ftl Bestand weergeven

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
 <html>
2
 <html>
3
 <head>
3
 <head>
4
-  	<title>调度中心</title>
4
+  	<title>${I18nUtil.getString("admin_name")}</title>
5
   	<#import "/common/common.macro.ftl" as netCommon>
5
   	<#import "/common/common.macro.ftl" as netCommon>
6
 	<@netCommon.commonStyle />
6
 	<@netCommon.commonStyle />
7
     <link rel="stylesheet" href="${request.contextPath}/static/adminlte/plugins/iCheck/square/blue.css">
7
     <link rel="stylesheet" href="${request.contextPath}/static/adminlte/plugins/iCheck/square/blue.css">
13
 		</div>
13
 		</div>
14
 		<form id="loginForm" method="post" >
14
 		<form id="loginForm" method="post" >
15
 			<div class="login-box-body">
15
 			<div class="login-box-body">
16
-				<p class="login-box-msg">任务调度中心</p>
16
+				<p class="login-box-msg">${I18nUtil.getString("admin_name")}</p>
17
 				<div class="form-group has-feedback">
17
 				<div class="form-group has-feedback">
18
-	            	<input type="text" name="userName" class="form-control" placeholder="请输入登录账号" value="admin" >
18
+	            	<input type="text" name="userName" class="form-control" placeholder="${I18nUtil.getString("login_username_placeholder")}" value="admin" maxlength="18" >
19
 	            	<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
19
 	            	<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
20
 				</div>
20
 				</div>
21
 	          	<div class="form-group has-feedback">
21
 	          	<div class="form-group has-feedback">
22
-	            	<input type="password" name="password" class="form-control" placeholder="请输入登录密码" value="123456" >
22
+	            	<input type="password" name="password" class="form-control" placeholder="${I18nUtil.getString("login_password_placeholder")}" value="123456" maxlength="18" >
23
 	            	<span class="glyphicon glyphicon-lock form-control-feedback"></span>
23
 	            	<span class="glyphicon glyphicon-lock form-control-feedback"></span>
24
 	          	</div>
24
 	          	</div>
25
 				<div class="row">
25
 				<div class="row">
26
 					<div class="col-xs-8">
26
 					<div class="col-xs-8">
27
 		              	<div class="checkbox icheck">
27
 		              	<div class="checkbox icheck">
28
 		                	<label>
28
 		                	<label>
29
-		                  		<input type="checkbox" name="ifRemember" > Remember Me
29
+		                  		<input type="checkbox" name="ifRemember" > ${I18nUtil.getString("login_remember_me")}
30
 		                	</label>
30
 		                	</label>
31
 						</div>
31
 						</div>
32
 		            </div><!-- /.col -->
32
 		            </div><!-- /.col -->
33
 		            <div class="col-xs-4">
33
 		            <div class="col-xs-4">
34
-						<button type="submit" class="btn btn-primary btn-block btn-flat">登录</button>
34
+						<button type="submit" class="btn btn-primary btn-block btn-flat">${I18nUtil.getString("login_btn")}</button>
35
 					</div>
35
 					</div>
36
 				</div>
36
 				</div>
37
 			</div>
37
 			</div>
38
 		</form>
38
 		</form>
39
 	</div>
39
 	</div>
40
 <@netCommon.commonScript />
40
 <@netCommon.commonScript />
41
+<script>
42
+var login_username_empty = '${I18nUtil.getString("login_username_empty")}';
43
+var login_username_lt_5 = '${I18nUtil.getString("login_username_lt_5")}';
44
+
45
+var login_password_empty = '${I18nUtil.getString("login_password_empty")}';
46
+var login_password_lt_5 = '${I18nUtil.getString("login_password_lt_5")}';
47
+
48
+var login_success = '${I18nUtil.getString("login_success")}';
49
+var login_fail = '${I18nUtil.getString("login_fail")}';
50
+var system_tips = '${I18nUtil.getString("system_tips")}';
51
+var system_ok = '${I18nUtil.getString("system_ok")}';
52
+</script>
41
 <script src="${request.contextPath}/static/plugins/jquery/jquery.validate.min.js"></script>
53
 <script src="${request.contextPath}/static/plugins/jquery/jquery.validate.min.js"></script>
42
 <script src="${request.contextPath}/static/adminlte/plugins/iCheck/icheck.min.js"></script>
54
 <script src="${request.contextPath}/static/adminlte/plugins/iCheck/icheck.min.js"></script>
43
 <script src="${request.contextPath}/static/js/login.1.js"></script>
55
 <script src="${request.contextPath}/static/js/login.1.js"></script>

+ 5 - 4
xxl-job-admin/src/main/webapp/static/js/common.1.js Bestand weergeven

2
 
2
 
3
 	// logout
3
 	// logout
4
 	$("#logoutBtn").click(function(){
4
 	$("#logoutBtn").click(function(){
5
-		layer.confirm('确认注销登录?', {icon: 3, title:'系统提示'}, function(index){
5
+		layer.confirm(logout_confirm, {icon: 3, title:system_tips}, function(index){
6
 			layer.close(index);
6
 			layer.close(index);
7
 
7
 
8
 			$.post(base_url + "/logout", function(data, status) {
8
 			$.post(base_url + "/logout", function(data, status) {
9
 				if (data.code == "200") {
9
 				if (data.code == "200") {
10
-                    layer.msg('注销成功');
10
+                    layer.msg(logout_success);
11
                     setTimeout(function(){
11
                     setTimeout(function(){
12
                         window.location.href = base_url + "/";
12
                         window.location.href = base_url + "/";
13
                     }, 500);
13
                     }, 500);
21
 					});*/
21
 					});*/
22
 				} else {
22
 				} else {
23
 					layer.open({
23
 					layer.open({
24
-						title: '系统提示',
25
-						content: (data.msg || "操作失败"),
24
+						title: system_tips,
25
+                        btn: [system_ok, system_close],
26
+						content: (data.msg || logout_fail),
26
 						icon: '2'
27
 						icon: '2'
27
 					});
28
 					});
28
 				}
29
 				}

+ 0 - 2
xxl-job-admin/src/main/webapp/static/js/index.js Bestand weergeven

1
 /**
1
 /**
2
  * Created by xuxueli on 17/4/24.
2
  * Created by xuxueli on 17/4/24.
3
  */
3
  */
4
-
5
-
6
 $(function () {
4
 $(function () {
7
 
5
 
8
     // 过滤时间
6
     // 过滤时间

+ 10 - 10
xxl-job-admin/src/main/webapp/static/js/login.1.js Bestand weergeven

25
         }, 
25
         }, 
26
         messages : {  
26
         messages : {  
27
         	userName : {  
27
         	userName : {  
28
-                required :"请输入登录账号."  ,
29
-                minlength:"登录账号不应低于5位",
30
-                maxlength:"登录账号不应超过18位"
31
-            },  
28
+                required  : login_username_empty,
29
+                minlength : login_username_lt_5
30
+            },
32
             password : {
31
             password : {
33
-            	required :"请输入登录密码."  ,
34
-                minlength:"登录密码不应低于5位",
35
-                maxlength:"登录密码不应超过18位"
32
+            	required  : login_password_empty  ,
33
+                minlength : login_password_lt_5
34
+                /*,maxlength:"登录密码不应超过18位"*/
36
             }
35
             }
37
         }, 
36
         }, 
38
 		highlight : function(element) {  
37
 		highlight : function(element) {  
48
         submitHandler : function(form) {
47
         submitHandler : function(form) {
49
 			$.post(base_url + "/login", $("#loginForm").serialize(), function(data, status) {
48
 			$.post(base_url + "/login", $("#loginForm").serialize(), function(data, status) {
50
 				if (data.code == "200") {
49
 				if (data.code == "200") {
51
-                    layer.msg('登录成功');
50
+                    layer.msg(login_success);
52
                     setTimeout(function(){
51
                     setTimeout(function(){
53
                         window.location.href = base_url;
52
                         window.location.href = base_url;
54
                     }, 500);
53
                     }, 500);
62
                     });*/
61
                     });*/
63
 				} else {
62
 				} else {
64
                     layer.open({
63
                     layer.open({
65
-                        title: '系统提示',
66
-                        content: (data.msg || "登录失败"),
64
+                        title: system_tips,
65
+                        btn: [system_ok],
66
+                        content: (data.msg || login_fail),
67
                         icon: '2'
67
                         icon: '2'
68
                     });
68
                     });
69
 				}
69
 				}