Ver Fonte

js控制评卷端多语言切换

ting.yin há 5 anos atrás
pai
commit
4237723f22
30 ficheiros alterados com 446 adições e 128 exclusões
  1. 1 1
      stmms-web/src/main/webapp/WEB-INF/views/include/head.jsp
  2. 3 0
      stmms-web/src/main/webapp/WEB-INF/views/modules/mark/markJson.jsp
  3. 4 1
      stmms-web/src/main/webapp/WEB-INF/views/modules/mark/markNew.jsp
  4. 3 0
      stmms-web/src/main/webapp/WEB-INF/views/modules/mark/markTrack.jsp
  5. 8 28
      stmms-web/src/main/webapp/WEB-INF/views/modules/sys/login.jsp
  6. 37 0
      stmms-web/src/main/webapp/static/i18n/load.js
  7. 72 2
      stmms-web/src/main/webapp/static/i18n/messages.properties
  8. 77 2
      stmms-web/src/main/webapp/static/i18n/messages_en.properties
  9. 8 0
      stmms-web/src/main/webapp/static/i18n/messages_ja.properties
  10. 77 2
      stmms-web/src/main/webapp/static/i18n/messages_zh.properties
  11. 16 2
      stmms-web/src/main/webapp/static/mark-json/js/mark-control.js
  12. 19 4
      stmms-web/src/main/webapp/static/mark-new/js/mark-control.js
  13. 2 1
      stmms-web/src/main/webapp/static/mark-new/js/modules/answer-view.js
  14. 6 5
      stmms-web/src/main/webapp/static/mark-new/js/modules/change-name.js
  15. 12 10
      stmms-web/src/main/webapp/static/mark-new/js/modules/mark-board.js
  16. 10 8
      stmms-web/src/main/webapp/static/mark-new/js/modules/mark-history.js
  17. 12 11
      stmms-web/src/main/webapp/static/mark-new/js/modules/mark-status.js
  18. 6 5
      stmms-web/src/main/webapp/static/mark-new/js/modules/problem-process.js
  19. 5 3
      stmms-web/src/main/webapp/static/mark-new/js/modules/sheet-view.js
  20. 6 5
      stmms-web/src/main/webapp/static/mark-new/js/modules/single-image-view.js
  21. 7 6
      stmms-web/src/main/webapp/static/mark-new/js/modules/specialTag.js
  22. 5 3
      stmms-web/src/main/webapp/static/mark-new/js/modules/thumbnail.js
  23. 3 2
      stmms-web/src/main/webapp/static/mark-new/js/modules/view-sidebar.js
  24. 10 9
      stmms-web/src/main/webapp/static/mark-new/js/modules/warning-info.js
  25. 18 4
      stmms-web/src/main/webapp/static/mark-track/js/mark-control.js
  26. 6 6
      stmms-web/src/main/webapp/static/mark-track/js/modules/mark-board.js
  27. 1 1
      stmms-web/src/main/webapp/static/mark-track/js/modules/sheet-view.js
  28. 6 6
      stmms-web/src/main/webapp/static/mark-track/js/modules/single-image-view.js
  29. 5 0
      stmms-web/src/main/webapp/static/rich-text/css/rich-text.css
  30. 1 1
      stmms-web/src/main/webapp/static/rich-text/js/render.js

+ 1 - 1
stmms-web/src/main/webapp/WEB-INF/views/include/head.jsp

@@ -35,5 +35,5 @@
 <script src="${ctxStatic}/jquery-jbox/2.3/i18n/jquery.jBox-zh-CN.min.js" type="text/javascript"></script>
 <script src="${ctxStatic}/utils/image-utils.js" type="text/javascript"></script>
 <script src="${ctxStatic}/i18n/jquery.i18n.properties.js" type="text/javascript"></script>
-
+<script src="${ctxStatic}/i18n/load.js" type="text/javascript"></script>
 <link rel="shortcut icon" href="${ctxStatic}/favicon.png">

+ 3 - 0
stmms-web/src/main/webapp/WEB-INF/views/modules/mark/markJson.jsp

@@ -18,6 +18,9 @@
 
     <script src="${ctxStatic}/perfect-scrollbar/min/perfect-scrollbar.min.js"></script>
     <link href="${ctxStatic}/perfect-scrollbar/min/perfect-scrollbar.min.css" rel="stylesheet">
+    
+    <script src="${ctxStatic}/i18n/jquery.i18n.properties.js" type="text/javascript"></script>
+	<script src="${ctxStatic}/i18n/load.js" type="text/javascript"></script>
 
     <script src="${ctxStatic}/rich-text/js/render.js"></script>
     <link href="${ctxStatic}/rich-text/css/rich-text.css" rel="stylesheet">

+ 4 - 1
stmms-web/src/main/webapp/WEB-INF/views/modules/mark/markNew.jsp

@@ -19,6 +19,9 @@
 <script src="${ctxStatic}/perfect-scrollbar/min/perfect-scrollbar.min.js"></script>
 <link href="${ctxStatic}/perfect-scrollbar/min/perfect-scrollbar.min.css" rel="stylesheet">
 
+<script src="${ctxStatic}/i18n/jquery.i18n.properties.js" type="text/javascript"></script>
+<script src="${ctxStatic}/i18n/load.js" type="text/javascript"></script>
+
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/mark-control.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/task-control.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/modules/answer-view.js"></script>
@@ -43,7 +46,7 @@
 	$(document).ajaxError(function(evt, req, settings){
 		if(req.status==401) {
 			alert("权限失效,请重新登录!");
-			 window.location.href = req.statusText;
+			window.location.href = req.statusText;
        	}
 	});
 

+ 3 - 0
stmms-web/src/main/webapp/WEB-INF/views/modules/mark/markTrack.jsp

@@ -13,6 +13,9 @@
 <script type="text/javascript" src="${ctxStatic}/mark-track/js/jquery-ui.min.js "></script>
 <script type="text/javascript" src="${ctxStatic}/mark-track/js/jquery.mousewheel.min.js"></script>
 
+<script src="${ctxStatic}/i18n/jquery.i18n.properties.js" type="text/javascript"></script>
+<script src="${ctxStatic}/i18n/load.js" type="text/javascript"></script>
+
 <script type="text/javascript" src="${ctxStatic}/mark-track/js/mark-control.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-new/js/task-control.js"></script>
 <script type="text/javascript" src="${ctxStatic}/mark-track/js/modules/object-view.js"></script>

+ 8 - 28
stmms-web/src/main/webapp/WEB-INF/views/modules/sys/login.jsp

@@ -22,27 +22,7 @@
             if (self.frameElement && self.frameElement.tagName == "IFRAME") {
                 parent.location.reload();
             }
-            loadProperties('en');
-
-            function loadProperties(locale) {
-                jQuery.i18n.properties({//加载资浏览器语言对应的资源文件
-                    name: 'messages', //资源文件名称
-                    path: '/resources/i18n/', //资源文件路径
-                    mode: 'map', //用Map的方式使用资源文件中的值
-                    language: locale,
-                    callback: function () {//加载成功后设置显示内容
-                        $("[data-i18n-value]").each(function () {
-                            $(this).val($.i18n.prop($(this).data("i18n-value")));
-                        });
-                        $("[data-i18n-text]").each(function () {
-                            $(this).text($.i18n.prop($(this).data("i18n-text")));
-                        });
-                        $("[data-i18n-html]").each(function () {
-                            $(this).html($.i18n.prop($(this).data("i18n-html")));
-                        });
-                    }
-                });
-            }
+            load();
         });
     </script>
 </head>
@@ -57,13 +37,13 @@
         </div>
         <div class="right">
             <div class="title">
-                <h1>高校考试管理平台</h1>
-                <c:if test="${loginType == 'admin-login' }"><p>管理员登录</p></c:if>
-                <c:if test="${loginType == 'mark-login' }"><p>评卷员登录</p></c:if>
+                <h1 data-i18n-text="user.login.title">高校考试管理平台</h1>
+                <c:if test="${loginType == 'admin-login' }"><p data-i18n-text="user.login.admin">管理员登录</p></c:if>
+                <c:if test="${loginType == 'mark-login' }"><p data-i18n-text="user.login.marker">评卷员登录</p></c:if>
                 <c:if test="${loginType == null || loginType == '' }">
                     <p><span><a href="#" class="<c:if test="${showType == 'admin-login' ||showType==null}">on</c:if>"
-                                id="adminLogin">管理员登录</a></span>
-                        <span><a href="#" class="<c:if test="${showType == 'mark-login' }">on</c:if>" id="markLogin">评卷员登录</a></span></p>
+                                id="adminLogin" data-i18n-text="user.login.admin">管理员登录</a></span>
+                        <span><a href="#" class="<c:if test="${showType == 'mark-login' }">on</c:if>" id="markLogin" data-i18n-text="user.login.marker">评卷员登录</a></span></p>
                 </c:if>
             </div>
             <div class="loginbox">
@@ -71,11 +51,11 @@
                     <input id="showType" name="showType" value="${showType}"/>
                     <div class="input-group">
                         <input type="text" class="form-control required" id="loginName" name="loginName" placeholder="请输入用户名"
-                               autocomplete="off" value="${loginName }"/>
+                               autocomplete="off" value="${loginName }" data-i18n-placeholder="user.login.name"/>
                     </div>
                     <div class="input-group">
                         <input type="password" class="form-control required" id="password" name="password" placeholder="请输入密码"
-                               autocomplete="off"/>
+                               autocomplete="off" data-i18n-placeholder="user.login.password"/>
                     </div>
                     <div class="point <c:if test="${message != null }"></c:if><c:if test="${message == null }">hide</c:if>">
                         <em class="error">${message }</em>

+ 37 - 0
stmms-web/src/main/webapp/static/i18n/load.js

@@ -0,0 +1,37 @@
+$(document).ready(function() {
+	load();
+})
+function load() {  
+	var language = (navigator.browserLanguage || navigator.language).toLowerCase();
+	if(language.indexOf('zh')>-1){
+		loadProperties('zh');
+	}else if(language.indexOf('en')>-1){
+		loadProperties('en');
+	}else if(language.indexOf('ja')>-1){
+		loadProperties('ja');
+	}else{
+		loadProperties('zh');
+	}
+	function loadProperties(locale) {  
+		jQuery.i18n.properties({//加载资浏览器语言对应的资源文件
+			name : 'messages', //资源文件名称
+			path : '/resources/i18n/', //资源文件路径
+			mode : 'map', //用Map的方式使用资源文件中的值
+			language : locale,
+			callback : function() {//加载成功后设置显示内容
+				$("[data-i18n-value]").each(function() {
+					$(this).val($.i18n.prop($(this).data("i18n-value")));
+				});
+				$("[data-i18n-text]").each(function() {
+					$(this).text($.i18n.prop($(this).data("i18n-text")));
+				});
+				$("[data-i18n-html]").each(function() {
+					$(this).html($.i18n.prop($(this).data("i18n-html")));
+				});
+				$("[data-i18n-placeholder]").each(function() {
+					$(this).attr('placeholder',$.i18n.prop($(this).data("i18n-placeholder")));
+				});
+			}
+		});			
+	}
+}

+ 72 - 2
stmms-web/src/main/webapp/static/i18n/messages.properties

@@ -1,8 +1,78 @@
+#login
+user.login.title=\u9ad8\u6821\u8003\u8bd5\u7ba1\u7406\u5e73\u53f0
 user.login.admin=\u7ba1\u7406\u5458\u767b\u5f55
 user.login.marker=\u8bc4\u5377\u5458\u767b\u5f55
 user.login.name=\u7528\u6237\u540d
 user.login.password=\u5bc6\u7801
 user.login.submit=\u767b\u5f55
 user.logout=\u9000\u51fa
-
-mark.progress=\u8fdb\u5ea6
+#mark-control
+mark.assistant=<i class="icon-wrench"></i> \u5c0f\u52a9\u624b
+mark.mode.track=\u5207\u6362\u5230\u8f68\u8ff9\u6a21\u5f0f
+mark.mode.common=\u5207\u6362\u5230\u666e\u901a\u6a21\u5f0f
+mark.function=\u8bc4\u5377\u529f\u80fd
+#status
+mark.student.number=\u8003\u751f\u7f16\u53f7<em id="student-number"></em>
+mark.library.number=\u4efb\u52a1\u7f16\u53f7<em id="library-number"></em>
+mark.objective.score=\u5ba2\u89c2\u5f97\u5206<em id="objective-score"></em>
+mark.marked.count=\u5df2\u8bc4<em id="person-count"></em>
+mark.unmark.count=\u672a\u8bc4<em id="todo-count"></em>
+mark.top.count=\u5206\u914d<em id="top-count"></em>
+mark.progress=\u8fdb\u5ea6<em id="marked-percent"></em>
+mark.continue=\u7ee7\u7eed
+mark.top.count.finish=\u5206\u914d\u4efb\u52a1\u5df2\u8bc4\u5b8c\uff0c\u662f\u5426\u7ee7\u7eed\uff1f
+mark.loading=\u6b63\u5728\u52a0\u8f7d...
+#single-image-view
+mark.zoom.in=\u653e\u5927
+mark.zoom.out=\u7f29\u5c0f
+mark.zoom.fit=\u9002\u5e94
+mark.student.answer=\u7b54\u5377
+#chang name
+mark.change.name=\u4fee\u6539\u4e2a\u4eba\u4fe1\u606f
+mark.name=\u8f93\u5165\u7528\u6237\u540d
+mark.password=\u8f93\u5165\u65b0\u5bc6\u7801
+mark.password.again=\u518d\u6b21\u8f93\u5165\u65b0\u5bc6\u7801
+#specialTag
+mark.special.tag=\u7279\u6b8a\u6807\u8bb0
+mark.back=\u56de\u9000
+mark.clear=\u5168\u90e8\u6e05\u9664
+mark.underline=\u4e0b\u5212\u7ebf
+mark.open=\u6253\u5f00
+mark.close=\u5173\u95ed
+#problem-process
+mark.problem=\u95ee\u9898\u5377
+mark.problem.type=\u9009\u62e9\u95ee\u9898\u7c7b\u578b
+mark.confirm=\u786e\u5b9a
+mark.cancel=\u53d6\u6d88
+#thumbnail
+mark.thumbnail=\u7f29\u7565\u56fe
+#view-sidebar
+mark.sidebar=\u4fa7\u8fb9\u680f
+#mark-history
+mark.history=\u56de\u8bc4
+mark.history.time=\u65f6\u95f4<em class="up" id="time-sort"></em>
+mark.history.number=\u7f16\u53f7<em class="up" id="studentId-sort">
+mark.history.score=\u603b\u5206<em class="up" id="score-sort">
+mark.history.search=\u67e5\u627e\u8bd5\u5377
+mark.history.pre=\u524d<i class="yellow" id="history-start"></i>-\u524d<i class="yellow" id="history-end"></i>
+mark.history.success=\u56de\u8bc4\u6210\u529f\uff0c\u603b\u5206\uff1a
+mark.history.problem=\u56de\u8bc4\u6210\u529f\uff0c\u5df2\u63d0\u4ea4\u95ee\u9898\u5377
+#mark-board
+mark.submit=\u63d0\u4ea4
+mark.total.score.board=\u603b\u5206\uff1a<i class="yellow" id="score-board-total-score"></i>
+mark.total.score=\u603b\u5206 <i id="total-score">5</i>
+mark.score.zero=\u5168\u96f6\u5206
+mark.pass=\u8df3 \u8fc7
+mark.choose.result=\u9009\u505a\u7ed3\u679c
+mark.keyboard=\u952e\u76d8\u7ed9\u5206 >>
+mark.mouse=<< \u9f20\u6807\u7ed9\u5206
+mark.interval=\u95f4\u9694
+mark.score=\u5206
+mark.clear.question=\u6e05\u9664\u672c\u9898
+#sheet-view
+mark.sheet=\u539f\u56fe
+mark.sheet.check=\u539f\u56fe\u5207\u6362
+#answer-view
+mark.answer=\u6807\u7b54
+#warning-info
+mark.try.again=\u8bf7\u70b9\u51fb\u91cd\u8bd5

+ 77 - 2
stmms-web/src/main/webapp/static/i18n/messages_en.properties

@@ -1,8 +1,83 @@
+#login
+user.login.title=College Management
 user.login.admin=Admin
 user.login.marker=Marker
 user.login.name=username
 user.login.password=password
 user.login.submit=Login
 user.logout=logout
-
-mark.progress=progress
+#mark-control
+mark.assistant=<i class="icon-wrench"></i>Assistant
+mark.mode.track=Track Mode
+mark.mode.common=Common Mode
+mark.function=Marking function
+#status
+mark.student.number=student number<em id="student-number"></em>
+mark.library.number=task number<em id="library-number"></em>
+mark.objective.score=objective score <em id="objective-score"></em>
+mark.marked.count=marked<em id="person-count"></em>
+mark.unmark.count=unmark<em id="todo-count"></em>
+mark.top.count=assigned<em id="top-count"></em>
+mark.progress=progress<em id="marked-percent"></em>
+mark.continue=continue
+mark.top.count.finish=The assigned task has been completed. Do you want to continue?
+mark.loading=loading...
+#single-image-view
+mark.zoom.in=Zoom in
+mark.zoom.out=Zoom out
+mark.zoom.fit=Zoom fit
+mark.student.answer=student answer
+#chang name
+mark.change.name=change userInfo
+mark.name=press your name
+mark.password=press new password
+mark.password.again=press new password again
+#specialTag
+mark.special.tag=Special tag
+mark.back=back
+mark.clear=clear all
+mark.underline=underline
+mark.open=open
+mark.close=close
+#problem-process
+mark.problem=Problem
+mark.problem.type=check problem type
+mark.confirm=ok
+mark.cancel=cancel
+#thumbnail
+mark.thumbnail=thumbnail
+#view-sidebar
+mark.sidebar=sidebar
+#mark-history
+mark.history=history
+mark.history.time=time<em class="up" id="time-sort"></em>
+mark.history.number=number<em class="up" id="studentId-sort">
+mark.history.score=score<em class="up" id="score-sort">
+mark.history.search=search
+mark.history.pre=pre<i class="yellow" id="history-start"></i>-pre<i class="yellow" id="history-end"></i>
+mark.history.success=successful,score: 
+mark.history.problem=submit problem successful 
+#mark-board
+mark.submit=submit
+mark.total.score.board=Score\uff1a<i class="yellow" id="score-board-total-score"></i>
+mark.total.score=Score <i id="total-score">5</i>
+mark.score.zero=all zero
+mark.pass=pass
+mark.choose.result=choose result
+mark.keyboard=mark by keyboard >>
+mark.mouse=<< mark by mouse
+mark.interval=interval:
+mark.score=
+mark.clear.question=clear
+#sheet-view
+mark.sheet=sheet
+mark.sheet.check=check sheet
+#answer-view
+mark.answer=answer
+#warning-info
+mark.try.again=please click try again
+mark.force.special.tag=Force special tag is onen, please use at least one special tag
+mark.network.error=network error,get task failed
+mark.task.error=get task failed
+mark.task.finish=marking task finished
+mark.task.loading=task loading

+ 8 - 0
stmms-web/src/main/webapp/static/i18n/messages_ja.properties

@@ -0,0 +1,8 @@
+user.login.admin=Admin
+user.login.marker=Marker
+user.login.name=username
+user.login.password=password
+user.login.submit=Login
+user.logout=logout
+
+mark.progress=progress

+ 77 - 2
stmms-web/src/main/webapp/static/i18n/messages_zh.properties

@@ -1,8 +1,83 @@
+#login
+user.login.title=\u9ad8\u6821\u8003\u8bd5\u7ba1\u7406\u5e73\u53f0
 user.login.admin=\u7ba1\u7406\u5458\u767b\u5f55
 user.login.marker=\u8bc4\u5377\u5458\u767b\u5f55
 user.login.name=\u7528\u6237\u540d
 user.login.password=\u5bc6\u7801
 user.login.submit=\u767b\u5f55
 user.logout=\u9000\u51fa
-
-mark.progress=\u8fdb\u5ea6
+#mark-control
+mark.assistant=<i class="icon-wrench"></i> \u5c0f\u52a9\u624b
+mark.mode.track=\u5207\u6362\u5230\u8f68\u8ff9\u6a21\u5f0f
+mark.mode.common=\u5207\u6362\u5230\u666e\u901a\u6a21\u5f0f
+mark.function=\u8bc4\u5377\u529f\u80fd
+#status
+mark.student.number=\u8003\u751f\u7f16\u53f7<em id="student-number"></em>
+mark.library.number=\u4efb\u52a1\u7f16\u53f7<em id="library-number"></em>
+mark.objective.score=\u5ba2\u89c2\u5f97\u5206<em id="objective-score"></em>
+mark.marked.count=\u5df2\u8bc4<em id="person-count"></em>
+mark.unmark.count=\u672a\u8bc4<em id="todo-count"></em>
+mark.top.count=\u5206\u914d<em id="top-count"></em>
+mark.progress=\u8fdb\u5ea6<em id="marked-percent"></em>
+mark.continue=\u7ee7\u7eed
+mark.top.count.finish=\u5206\u914d\u4efb\u52a1\u5df2\u8bc4\u5b8c\uff0c\u662f\u5426\u7ee7\u7eed\uff1f
+mark.loading=\u6b63\u5728\u52a0\u8f7d...
+#single-image-view
+mark.zoom.in=\u653e\u5927
+mark.zoom.out=\u7f29\u5c0f
+mark.zoom.fit=\u9002\u5e94
+mark.student.answer=\u7b54\u5377
+#chang name
+mark.change.name=\u4fee\u6539\u4e2a\u4eba\u4fe1\u606f
+mark.name=\u8f93\u5165\u7528\u6237\u540d
+mark.password=\u8f93\u5165\u65b0\u5bc6\u7801
+mark.password.again=\u518d\u6b21\u8f93\u5165\u65b0\u5bc6\u7801
+#specialTag
+mark.special.tag=\u7279\u6b8a\u6807\u8bb0
+mark.back=\u56de\u9000
+mark.clear=\u5168\u90e8\u6e05\u9664
+mark.underline=\u4e0b\u5212\u7ebf
+mark.open=\u6253\u5f00
+mark.close=\u5173\u95ed
+#problem-process
+mark.problem=\u95ee\u9898\u5377
+mark.problem.type=\u9009\u62e9\u95ee\u9898\u7c7b\u578b
+mark.confirm=\u786e\u5b9a
+mark.cancel=\u53d6\u6d88
+#thumbnail
+mark.thumbnail=\u7f29\u7565\u56fe
+#view-sidebar
+mark.sidebar=\u4fa7\u8fb9\u680f
+#mark-history
+mark.history=\u56de\u8bc4
+mark.history.time=\u65f6\u95f4<em class="up" id="time-sort"></em>
+mark.history.number=\u7f16\u53f7<em class="up" id="studentId-sort">
+mark.history.score=\u603b\u5206<em class="up" id="score-sort">
+mark.history.search=\u67e5\u627e\u8bd5\u5377
+mark.history.pre=\u524d<i class="yellow" id="history-start"></i>-\u524d<i class="yellow" id="history-end"></i>
+mark.history.success=\u56de\u8bc4\u6210\u529f\uff0c\u603b\u5206\uff1a
+mark.history.problem=\u56de\u8bc4\u6210\u529f\uff0c\u5df2\u63d0\u4ea4\u95ee\u9898\u5377
+#mark-board
+mark.submit=\u63d0\u4ea4
+mark.total.score.board=\u603b\u5206\uff1a<i class="yellow" id="score-board-total-score"></i>
+mark.total.score=\u603b\u5206 <i id="total-score">5</i>
+mark.score.zero=\u5168\u96f6\u5206
+mark.pass=\u8df3 \u8fc7
+mark.choose.result=\u9009\u505a\u7ed3\u679c
+mark.keyboard=\u952e\u76d8\u7ed9\u5206 >>
+mark.mouse=<< \u9f20\u6807\u7ed9\u5206
+mark.interval=\u95f4\u9694
+mark.score=\u5206
+mark.clear.question=\u6e05\u9664\u672c\u9898
+#sheet-view
+mark.sheet=\u539f\u56fe
+mark.sheet.check=\u539f\u56fe\u5207\u6362
+#answer-view
+mark.answer=\u6807\u7b54
+#warning-info
+mark.try.again=\u8bf7\u70b9\u51fb\u91cd\u8bd5
+mark.force.special.tag=\u5f3a\u5236\u7279\u6b8a\u6807\u8bb0\u5df2\u5f00\u542f\uff0c\u81f3\u5c11\u4f7f\u7528\u4e00\u4e2a\u7279\u6b8a\u6807\u8bb0
+mark.network.error=\u7f51\u7edc\u5f02\u5e38\uff0c\u4efb\u52a1\u63d0\u4ea4\u5931\u8d25
+mark.task.error=\u9886\u53d6\u8bc4\u5377\u4efb\u52a1\u51fa\u9519
+mark.task.finish=\u8bc4\u5377\u4efb\u52a1\u5df2\u5b8c\u6210
+mark.task.loading=\u8bc4\u5377\u4efb\u52a1\u6b63\u5728\u52a0\u8f7d\u4e2d

+ 16 - 2
stmms-web/src/main/webapp/static/mark-json/js/mark-control.js

@@ -656,9 +656,9 @@ MarkControl.prototype.center_dom = '<div class="center-content span12"></div>';
 
 MarkControl.prototype.center_header_dom = '<div class="row-fluid"><div class="header"><p class="tips">\
 <em>\
-<a href="javascript:void(0)" id="assistant-button" class="btn"><i class="icon-wrench"></i> 小助手</a></em>\
+<a href="javascript:void(0)" id="assistant-button" class="btn" data-i18n-html="mark.assistant"><i class="icon-wrench"></i> 小助手</a></em>\
 <a class="useinfo" href="#"><i class="icon-user icon-white"></i><i id="mark-user-name"></i></a>\
-<a class="logout" id="logout-link" href="{logoutUrl}"><i class="icon-off icon-white"></i> <i id="logout-title">退出</i></a>\
+<a class="logout" id="logout-link" href="{logoutUrl}"><i class="icon-off icon-white"></i> <i id="logout-title" data-i18n-text="user.logout">退出</i></a>\
 </p></div></div>';
 
 MarkControl.prototype.center_content_dom = '<div class="row-fluid"></div>';
@@ -717,4 +717,18 @@ function getDom(content, markControl) {
 
 function isArray(obj) {
     return obj != undefined && Object.prototype.toString.call(obj) === '[object Array]';
+}
+function loadLanguage() {  
+	$("[data-i18n-value]").each(function() {
+		$(this).val($.i18n.prop($(this).data("i18n-value")));
+	});
+	$("[data-i18n-text]").each(function() {
+		$(this).text($.i18n.prop($(this).data("i18n-text")));
+	});
+	$("[data-i18n-html]").each(function() {
+		$(this).html($.i18n.prop($(this).data("i18n-html")));
+	});
+	$("[data-i18n-placeholder]").each(function() {
+		$(this).attr('placeholder',$.i18n.prop($(this).data("i18n-placeholder")));
+	});
 }

+ 19 - 4
stmms-web/src/main/webapp/static/mark-new/js/mark-control.js

@@ -660,10 +660,10 @@ MarkControl.prototype.sidebar_dom = '<div class="mark-sidebar span2 hide"></div>
 MarkControl.prototype.center_dom = '<div class="center-content span12"></div>';
 
 MarkControl.prototype.center_header_dom = '<div class="row-fluid"><div class="header"><p class="tips">\
-<em><a href="##" class="btn" id="switch-track-button" style="display:none">切换到轨迹模式</a>\
-<a href="javascript:void(0)" id="assistant-button" class="btn"><i class="icon-wrench"></i> 小助手</a></em>\
+<em><a href="##" class="btn" id="switch-track-button" style="display:none" data-i18n-text="mark.mode.track">切换到轨迹模式</a>\
+<a href="javascript:void(0)" id="assistant-button" class="btn" data-i18n-html="mark.assistant"><i class="icon-wrench"></i> 小助手</a></em>\
 <a class="useinfo" href="#"><i class="icon-user icon-white"></i><i id="mark-user-name"></i></a>\
-<a class="logout" id="logout-link" href="{logoutUrl}"><i class="icon-off icon-white"></i> <i id="logout-title">退出</i></a>\
+<a class="logout" id="logout-link" href="{logoutUrl}"><i class="icon-off icon-white"></i> <i id="logout-title" data-i18n-text="user.logout">退出</i></a>\
 </p></div></div>';
 
 MarkControl.prototype.center_content_dom = '<div class="row-fluid"></div>';
@@ -672,7 +672,7 @@ MarkControl.prototype.image_content_dom = '<div class="image-content span12"></d
 
 MarkControl.prototype.assistant_dom = '<div class="popover bottom assistant"><div class="arrow"></div></div>';
 
-MarkControl.prototype.mark_function_dom = '<h3 class="popover-title">评卷功能</h3>\
+MarkControl.prototype.mark_function_dom = '<h3 class="popover-title" data-i18n-text="mark.function">评卷功能</h3>\
 <div class="popover-content"><p id="function-list" class="popover-list">\
 </p></div>';
 
@@ -722,4 +722,19 @@ function getDom(content, markControl) {
 
 function isArray(obj) {
     return obj != undefined && Object.prototype.toString.call(obj) === '[object Array]';
+}
+
+function loadLanguage() {  
+	$("[data-i18n-value]").each(function() {
+		$(this).val($.i18n.prop($(this).data("i18n-value")));
+	});
+	$("[data-i18n-text]").each(function() {
+		$(this).text($.i18n.prop($(this).data("i18n-text")));
+	});
+	$("[data-i18n-html]").each(function() {
+		$(this).html($.i18n.prop($(this).data("i18n-html")));
+	});
+	$("[data-i18n-placeholder]").each(function() {
+		$(this).attr('placeholder',$.i18n.prop($(this).data("i18n-placeholder")));
+	});
 }

+ 2 - 1
stmms-web/src/main/webapp/static/mark-new/js/modules/answer-view.js

@@ -9,6 +9,7 @@ function AnswerView(option) {
     this.markControl = option.markControl;
     this.server = option.server;
     this.init();
+    loadLanguage();
     this.markControl.on('task.get.success', this, function(event, context, eventObject) {
         this.render(this.server + context.task.answerUrl);
     });
@@ -35,4 +36,4 @@ AnswerView.prototype.render = function(url) {
     }
 }
 
-AnswerView.prototype.toggle_button_dom = '<a href="#" target="_blank">标答</a>';
+AnswerView.prototype.toggle_button_dom = '<a href="#" target="_blank" data-i18n-text="mark.answer">标答</a>';

+ 6 - 5
stmms-web/src/main/webapp/static/mark-new/js/modules/change-name.js

@@ -75,6 +75,7 @@ function ChangeName(option) {
                     self.popover.userNameMessage.html('网络通信错误,请稍后重试');
                 });
     });
+    loadLanguage();
 }
 
 ChangeName.prototype.toggle = function(enable) {
@@ -94,12 +95,12 @@ ChangeName.prototype.toggle = function(enable) {
 }
 
 ChangeName.prototype.popover_dom = '<div class="message-popover" style="display:none"><div class="popover-header">\
-<p class="title">修改个人信息</p><p class="image-close"><img src="{staticServer}/mark-new/images/images-close.png" /></p></div>\
-<div class="popover-cont"><span style="color: red;">*</span><input type="text" class="username-input" placeholder="请输入您的姓名" />\
+<p class="title" data-i18n-text="mark.change.name">修改个人信息</p><p class="image-close"><img src="{staticServer}/mark-new/images/images-close.png" /></p></div>\
+<div class="popover-cont"><span style="color: red;">*</span><input type="text" class="username-input" placeholder="请输入您的姓名" data-i18n-placeholder="mark.name"/>\
 <i class="wrong username"></i></div>\
-<div class="popover-cont"><input type="password" class="password-input" placeholder="请输入新的密码" />\
+<div class="popover-cont"><input type="password" class="password-input" placeholder="请输入新的密码" data-i18n-placeholder="mark.password"/>\
  <i class="wrong password"></i></div>\
- <div class="popover-cont"><input type="password" class="password2-input" placeholder="请再次输入您的密码" /> \
+ <div class="popover-cont"><input type="password" class="password2-input" placeholder="请再次输入您的密码" data-i18n-placeholder="mark.password.again"/> \
  <i class="wrong password2"></i></div>\
-<a href="#" class="btn btn-small btn-info text-userInfo">确定</a>\
+<a href="#" class="btn btn-small btn-info text-userInfo" data-i18n-text="mark.confirm">确定</a>\
 </div>';

+ 12 - 10
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-board.js

@@ -14,6 +14,8 @@ function MarkBoard(option) {
     this.enableSkip = option.enableSkip === true ? true : false;
 
     this.init();
+    loadLanguage();
+    
     this.markControl.on('task.get.before', this, function(event, context, eventObject) {
         this.task = undefined;
         this.stepList = undefined;
@@ -508,7 +510,7 @@ MarkBoard.prototype.render = function(task) {
             var dom = getDom(this.step_dom, this.markControl);
             dom.attr('data-number', step.number);
             dom.find('.step-title').html(step.title);
-            dom.find('.interval-score').html('间隔' + step.interval + '分');
+            dom.find('.interval-score').html($.i18n.prop("mark.interval") + step.interval + $.i18n.prop("mark.score"));
             dom.find('.max-score').html(step.max);
             dom.find('.min-score').html(step.min);
             if (step.markFinish === true) {
@@ -678,9 +680,9 @@ MarkBoard.prototype.onFocusChange = function() {
 }
 
 MarkBoard.prototype.step_board_dom = '<div class="span2 mark-steps" style="display:none"><div class="step-board">\
-<a href="#" class="header" id="show-score-board-button"><< 鼠标给分</a>\
-<div class="sublist"><p class="fraction">总分 <i id="total-score">5</i></p><div>\
-<a href="#" class="header all-zero-button">全零分</a>\
+<a href="#" class="header" id="show-score-board-button" data-i18n-text="mark.mouse"><< 鼠标给分</a>\
+<div class="sublist"><p class="fraction" data-i18n-html="mark.total.score">总分 <i id="total-score">5</i></p><div>\
+<a href="#" class="header all-zero-button" data-i18n-text="mark.score.zero">全零分</a>\
 <div class="step-list"></div>\
 </div></div>';
 
@@ -699,7 +701,7 @@ MarkBoard.prototype.scoreBoard_dom = '<div class="score-board score-board-popove
 MarkBoard.prototype.scoreBoard_header_dom = '<div class="header">\
 <p class="fl" id="score-board-header"></p>\
 <a class="header-close" id="score-board-close-button" href="#">\
-<i class="header-text">键盘给分 >></i></a>\
+<i class="header-text" data-i18n-text="mark.keyboard">键盘给分 >></i></a>\
 </div>';
 
 MarkBoard.prototype.scoreBoard_stepHolder_dom = '<div class="content"></div>';
@@ -712,15 +714,15 @@ MarkBoard.prototype.scoreBoard_step_dom = '<div class="sublist">\
 MarkBoard.prototype.scoreBoard_score_dom = '<a href="#" class="score-select"></a>';
 
 MarkBoard.prototype.scoreBoard_footer_dom = '<div class="footer">\
-<p class="font">总分:<i class="yellow" id="score-board-total-score"></i></p>\
-<a id="task-submit-button" class="button" href="#">提 交</a>\
-<a class="button all-zero-button" href="##">全零分</a>\
-<a id="task-pass-button" class="button" href="#" style="display:none">跳 过</a>\
+<p class="font" data-i18n-html="mark.total.score.board">总分:<i class="yellow" id="score-board-total-score"></i></p>\
+<a id="task-submit-button" class="button" href="#" data-i18n-text="mark.submit">提 交</a>\
+<a class="button all-zero-button" href="##" data-i18n-text="mark.score.zero">全零分</a>\
+<a id="task-pass-button" class="button" href="#" style="display:none" data-i18n-text="mark.pass">跳 过</a>\
 </div>';
 
 MarkBoard.prototype.popover_dom = '<div class="popover left assistant">\
 <div class="arrow"></div>\
 <h3 class="popover-title"></h3></div>';
 
-MarkBoard.prototype.scoreBoard_selective_dom = '<i class="fl">选做结果</i>\
+MarkBoard.prototype.scoreBoard_selective_dom = '<i class="fl" data-i18n-text="mark.choose.result">选做结果</i>\
 <select class="block-id-list span1 mr-t"></select>';

+ 10 - 8
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-history.js

@@ -166,6 +166,7 @@ MarkHistory.prototype.init = function() {
     this.container.find('#studentId-in').click(this, function(event) {
         self.markControl.trigger('mark.focus.change');
     });
+    loadLanguage();
 }
 MarkHistory.prototype.orderSearch = function(order) {
     this.order = order;
@@ -289,29 +290,30 @@ MarkHistory.prototype.updateTaskScore = function(score) {
     });
 }
 
-MarkHistory.prototype.toggle_button_dom = '<a href="#">回评</a>';
+MarkHistory.prototype.toggle_button_dom = '<a href="#" data-i18n-text="mark.history">回评</a>';
 
 MarkHistory.prototype.header_dom = '<div class="header">\
-<p class="fl">回评</p>\
+<p class="fl" data-i18n-text="mark.history">回评</p>\
 <a href="#" id="close-history-button"><img src="{staticServer}/mark-new/images/hp-close.png" /></a>\
 </div>';
 
 MarkHistory.prototype.paginator_dom = '<div class="c-page">\
 <a class="back" id="last-page-button" href="#"></a>\
 <a class="next" id="next-page-button" href="#"></a>\
-<span>前<i class="yellow" id="history-start"></i>-前<i class="yellow" id="history-end"></i></span>\
+<span data-i18n-html="mark.history.pre">前<i class="yellow" id="history-start"></i>-前<i class="yellow" id="history-end"></i></span>\
 </div>';
 
 MarkHistory.prototype.history_search_dom = '<div class="c-scbar cl">\
 <table id="history-search" cellpadding="0" cellspacing="0" width="100%">\
-<tr><td class="sc"><span><input type="text" placeholder="查找试卷" id="studentId-in" maxlength="10"/><em id="studentId-search"></em></span></td>\
+<tr><td class="sc"><span><input type="text" placeholder="查找试卷" id="studentId-in" maxlength="10" data-i18n-placeholder="mark.history.search"/><em id="studentId-search"></em></span></td>\
 </tr></table></div>';
 
 MarkHistory.prototype.history_list_dom = '<div class="sublist"><div class="c-table">\
-<table class="table table-hover" cellpadding="0" cellspacing="0" width="100%">\
-<thead><tr><th id="studentId-sort-th">编号<em class="up" id="studentId-sort"></th>\
-<th id="time-sort-th">时间<em class="up" id="time-sort"></em></th><th id="score-sort-th">总分<em class="up" id="score-sort"></th></tr></thead>\
-<tbody class="loding" id="history-loading"><tr><td colspan="3"><div><img src="{staticServer}/mark-new/images/loding.gif"/></div><p>正在加载请稍候</p></td></tr></tbody>\
+<table class="table table-hover" cellpadding="0" cellspacing="0" width="100%"><thead><tr>\
+<th id="studentId-sort-th" data-i18n-html="mark.history.number">编号<em class="up" id="studentId-sort"></th>\
+<th id="time-sort-th" data-i18n-html="mark.history.time">时间<em class="up" id="time-sort"></em></th>\
+<th id="score-sort-th" data-i18n-html="mark.history.score">总分<em class="up" id="score-sort"></th></tr></thead>\
+<tbody class="loding" id="history-loading"><tr><td colspan="3"><div><img src="{staticServer}/mark-new/images/loding.gif"/></div><p data-i18n-text="mark.loading">正在加载请稍候</p></td></tr></tbody>\
 <tbody id="history-list"></tbody></table></div></div>';
 
 MarkHistory.prototype.history_row_dom = '<tr><td class="history-secret-number"></td>\

+ 12 - 11
stmms-web/src/main/webapp/static/mark-new/js/modules/mark-status.js

@@ -8,6 +8,7 @@ var mark_status = function(option, success) {
 function MarkStatus(option) {
     this.markControl = option.markControl;
     this.init(option);
+    loadLanguage();
     this.markControl.on('task.get.before', this, function(event, context, statusInfo) {
         this.changeStatus('正在加载');
         this.clearTopTitle();
@@ -148,21 +149,21 @@ MarkStatus.prototype.render = function(status) {
 
 MarkStatus.prototype.status_dom = '<p class="text">\
 <i id="subject-title" style="cursor:pointer"><em id="subject-name"></em></i>\
-<i id="status-title"><em id="status-name"></em></i>\
-<i id="library-title" style="display:none">任务编号<em id="library-number"></em></i>\
-<i id="student-title" style="display:none">考生编号<em id="student-number"></em></i>\
-<i id="objective-area" style="display:none">客观得分<em id="objective-score"></em></i>\
-<i>已评<em id="person-count"></em></i>\
+<i id="status-title"><em id="status-name" data-i18n-text="mark.loading"></em></i>\
+<i id="library-title" style="display:none" data-i18n-html="mark.library.number">任务编号<em id="library-number"></em></i>\
+<i id="student-title" style="display:none" data-i18n-html="mark.student.number">考生编号<em id="student-number"></em></i>\
+<i id="objective-area" style="display:none" data-i18n-html="mark.objective.score">客观得分<em id="objective-score"></em></i>\
+<i data-i18n-html="mark.marked.count">已评<em id="person-count"></em></i>\
 </p>';
 
 MarkStatus.prototype.progress_dom = '<p class="text">\
-<i id="top-count-area" style="display:none">分配<em id="top-count"></em></i>\
-<i>未评<em id="todo-count"></em></i>\
-<i>进度<em id="marked-percent"></em></i>\
+<i id="top-count-area" style="display:none" data-i18n-html="mark.top.count">分配<em id="top-count"></em></i>\
+<i data-i18n-html="mark.unmark.count">未评<em id="todo-count"></em></i>\
+<i data-i18n-html="mark.progress">进度<em id="marked-percent"></em></i>\
 </p>';
 
 MarkStatus.prototype.popover_dom = '<div class="warning-popover">\
-<p>分配任务已评完,是否继续?</p>\
-<a href="#" class="btn btn-large btn-primary text-c" id="continue-button">继续</a>\
-<a href="{logoutUrl}" class="btn btn-large text-c" id="exit-button">退出</a>\
+<p data-i18n-text="mark.top.count.finish">分配任务已评完,是否继续?</p>\
+<a href="#" class="btn btn-large btn-primary text-c" id="continue-button" data-i18n-text="mark.continue">继续</a>\
+<a href="{logoutUrl}" class="btn btn-large text-c" id="exit-button" data-i18n-text="user.logout">退出</a>\
 </div>';

+ 6 - 5
stmms-web/src/main/webapp/static/mark-new/js/modules/problem-process.js

@@ -10,6 +10,7 @@ function ProblemProcess(option) {
     this.problemTypes =JSON.parse(option.problemTypes);
     this.context = option.markControl.context;
     this.init();
+    loadLanguage() 
     this.markControl.on('task.get.before', this, function(event, context, eventObject) {
         this.task = undefined;
         this.reset();
@@ -94,16 +95,16 @@ ProblemProcess.prototype.submit = function(problemId) {
     }
 }
 
-ProblemProcess.prototype.container_dom = '<h3 class="popover-title">问题卷</h3>\
+ProblemProcess.prototype.container_dom = '<h3 class="popover-title" data-i18n-text="mark.problem">问题卷</h3>\
 	<div class="popover-content"><p id="type-info-list" class="popover-list">\
-	<a href="#" id="show-problem-button">选择问题卷类型</a>\
+	<a href="#" id="show-problem-button" data-i18n-text="mark.problem.type">选择问题卷类型</a>\
 	</p></div>';
 
 ProblemProcess.prototype.button_dom = '<input type="radio" class="problemId" name="problemId">';
 
 ProblemProcess.prototype.popover_dom = '<div class="message-popover" style="display:none;"><div class="popover-header">\
-	<p class="title">问题卷</p><p class="image-close"><img src="{staticServer}/mark-new/images/images-close.png" /></p></div>\
+	<p class="title" data-i18n-text="mark.problem">问题卷</p><p class="image-close"><img src="{staticServer}/mark-new/images/images-close.png" /></p></div>\
 	<div id="problem-type-list" style="text-align:left;"></div>\
-	<a href="#" class="btn btn-small btn-info submit-btn">确定</a>\
-	<a href="#" class="btn btn-small btn-info close-btn">取消</a>\
+	<a href="#" class="btn btn-small btn-info submit-btn" data-i18n-text="mark.confirm">确定</a>\
+	<a href="#" class="btn btn-small btn-info close-btn" data-i18n-text="mark.cancel">取消</a>\
 	</div>';

+ 5 - 3
stmms-web/src/main/webapp/static/mark-new/js/modules/sheet-view.js

@@ -14,6 +14,8 @@ function SheetView(option) {
         this.sheetConfig = [];
     }
     this.init();
+    loadLanguage();
+    
     this.markControl.on('task.get.success', this, function(event, context, eventObject) {
         this.render(context.task.sheetUrls);
     });
@@ -139,15 +141,15 @@ SheetView.prototype.toggle = function(show) {
     }
 }
 
-SheetView.prototype.control_dom = '<h3 class="popover-title">查看原卷</h3>\
+SheetView.prototype.control_dom = '<h3 class="popover-title" data-i18n-text="mark.sheet">查看原卷</h3>\
 <div class="popover-content"><p id="sheet-list" class="popover-list">\
-<a href="#" id="show-sheet-button">打开</a><a href="#" id="hide-sheet-button">关闭</a>\
+<a href="#" id="show-sheet-button" data-i18n-text="mark.open">打开</a><a href="#" id="hide-sheet-button" data-i18n-text="mark.close">关闭</a>\
 </p></div>';
 
 SheetView.prototype.container_dom = '<div class="image-view-popover sheet" style=" width:100%; height:100vh;"></div>';
 
 SheetView.prototype.container_header_dom = '<div class="popover-header">\
-    <p class="title">原图切换</p>\
+    <p class="title" data-i18n-text="mark.sheet.check">原图切换</p>\
     <p class="image-switch"></p>\
     <p class="image-close"><img src="{staticServer}/mark-new/images/images-close-b.png" /></p></div>';
 

+ 6 - 5
stmms-web/src/main/webapp/static/mark-new/js/modules/single-image-view.js

@@ -59,6 +59,7 @@ function SingleImageView(option) {
             this.scale = Number(scale);
         }
     });
+    loadLanguage();
 }
 
 SingleImageView.prototype.init = function() {
@@ -82,11 +83,11 @@ SingleImageView.prototype.init = function() {
     });
 
     this.imageControl = getDom(this.image_control_dom, this.markControl).insertBefore(this.markControl.container.assistantButton.parent());
-    this.imageControl.find('.zoom-out-button').click(this, function(event) {
+    this.imageControl.find('.zoom-in-button').click(this, function(event) {
         self.reloadImage(0.2);
         self.markControl.trigger('image.reload.event');
     });
-    this.imageControl.find('.zoom-in-button').click(this, function(event) {
+    this.imageControl.find('.zoom-out-button').click(this, function(event) {
         self.reloadImage(-0.2);
         self.markControl.trigger('image.reload.event');
     });
@@ -161,7 +162,7 @@ SingleImageView.prototype.updateScrollTop = function(scrollTopPercent) {
 }
 
 SingleImageView.prototype.image_control_dom = '<em>\
-<a href="#" class="btn zoom-out-button">放大</a>\
-<a href="#" class="btn zoom-in-button">缩小</a>\
-<a href="#" class="btn zoom-fit-button">适应</a>\
+<a href="#" class="btn zoom-in-button" data-i18n-text="mark.zoom.in">放大</a>\
+<a href="#" class="btn zoom-out-button" data-i18n-text="mark.zoom.out">缩小</a>\
+<a href="#" class="btn zoom-fit-button" data-i18n-text="mark.zoom.fit">适应</a>\
 </em>';

+ 7 - 6
stmms-web/src/main/webapp/static/mark-new/js/modules/specialTag.js

@@ -11,6 +11,7 @@ function SpecialTag(option) {
     this.show = false;
     this.tagName = undefined;
     this.init();
+    loadLanguage();
     this.markControl.on('task.get.before', this, function(event, context, eventObject) {
         this.task = undefined;
         this.reset();
@@ -140,7 +141,7 @@ SpecialTag.prototype.reset = function() {
 SpecialTag.prototype.container_dom = '<div class="score-board score-board-popover" style="display:none"></div>';
 
 SpecialTag.prototype.container_header_dom = '<div class="header" style="border-radius: 15px 15px 0px 0px;">\
-<p class="fl" id="header">特殊标记</p>\
+<p class="fl" id="header" data-i18n-text="mark.special.tag">特殊标记</p>\
 <a class="header-close" id="close-button" href="#"><img src="{staticServer}/images/close.png"></a>\
 </div>';
 
@@ -149,11 +150,11 @@ SpecialTag.prototype.container_content_dom = '<div class="content popover-conten
     <a href="#" value="√">√</a>\
     <a href="#" value="X">×</a>\
     <a href="#" value="乄">乄</a>\
-	<a href="#" value="___" ><u>下划线</u></a></p>\
-<p><a href="#" id="undo-button" style="margin-left: 20px;">回&nbsp;&nbsp;&nbsp;退</a>\
-<a href="#" id="clear-button">全部清除</a></p></div>';
+	<a href="#" value="___" ><u data-i18n-text="mark.underline">下划线</u></a></p>\
+<p><a href="#" id="undo-button" style="margin-left: 20px;" data-i18n-text="mark.back">回&nbsp;&nbsp;&nbsp;退</a>\
+<a href="#" id="clear-button" data-i18n-text="mark.clear">全部清除</a></p></div>';
 
-SpecialTag.prototype.control_dom = '<h3 class="popover-title">特殊标记</h3>\
+SpecialTag.prototype.control_dom = '<h3 class="popover-title" data-i18n-text="mark.special.tag">特殊标记</h3>\
 <div class="popover-content"><p id="problem-list" class="popover-list">\
-<a href="#" id="show-SpecialTag-button">打开</a><a href="#" id="hide-SpecialTag-button">关闭</a>\
+<a href="#" id="show-SpecialTag-button" data-i18n-text="mark.open">打开</a><a href="#" id="hide-SpecialTag-button" data-i18n-text="mark.close">关闭</a>\
 </p></div>';

+ 5 - 3
stmms-web/src/main/webapp/static/mark-new/js/modules/thumbnail.js

@@ -16,6 +16,8 @@ function Thumbnail(option) {
     this.mousePosition = undefined;
 
     this.init();
+    loadLanguage();
+    
     this.markControl.on('task.get.before', this, function(event, context, eventObject) {
         this.task = undefined;
         this.render();
@@ -127,13 +129,13 @@ Thumbnail.prototype.updatePosition = function(e) {
 Thumbnail.prototype.container_dom = '<div class="score-board score-board-popover" style="display:none"></div>';
 
 Thumbnail.prototype.container_header_dom = '<div class="header">\
-<p class="fl" id="header">缩略图</p>\
+<p class="fl" id="header" data-i18n-text="mark.thumbnail">缩略图</p>\
 <a class="header-close" id="close-button" href="#"><img src="{staticServer}/images/close.png"></a>\
 </div>';
 
 Thumbnail.prototype.container_content_dom = '<div class="content" style="padding:4px;overflow:scroll"><img src=""></div>';
 
-Thumbnail.prototype.control_dom = '<h3 class="popover-title">缩略图</h3>\
+Thumbnail.prototype.control_dom = '<h3 class="popover-title" data-i18n-text="mark.thumbnail">缩略图</h3>\
 <div class="popover-content"><p id="problem-list" class="popover-list">\
-<a href="#" id="show-thumbnail-button">打开</a><a href="#" id="hide-thumbnail-button">关闭</a>\
+<a href="#" id="show-thumbnail-button" data-i18n-text="mark.open">打开</a><a href="#" id="hide-thumbnail-button" data-i18n-text="mark.close">关闭</a>\
 </p></div>';

+ 3 - 2
stmms-web/src/main/webapp/static/mark-new/js/modules/view-sidebar.js

@@ -1,4 +1,4 @@
-//回评模块
+//侧边栏
 var view_sidebar = function(option, success) {
     var object = new ViewSidebar(option);
     success();
@@ -9,6 +9,7 @@ function ViewSidebar(option) {
     this.markControl = option.markControl;
     this.list = option.list;
     this.init();
+    loadLanguage();
 }
 
 ViewSidebar.prototype.init = function() {
@@ -82,7 +83,7 @@ ViewSidebar.prototype.changeContent = function(url) {
     this.container.content.append(dom);
 }
 
-ViewSidebar.prototype.toggle_button_dom = '<a href="#">侧边栏</a>';
+ViewSidebar.prototype.toggle_button_dom = '<a href="#" data-i18n-text="mark.sidebar">侧边栏</a>';
 
 ViewSidebar.prototype.container_dom = '<div class="mark-sidebar span5 hide">\
 <div class="header"><p class="fl" id="view-list"></p>\

+ 10 - 9
stmms-web/src/main/webapp/static/mark-new/js/modules/warning-info.js

@@ -9,13 +9,14 @@ function WarningInfo(option) {
     this.option = option;
     this.markControl = option.markControl;
     this.init();
+    loadLanguage();
     var self = this;
 
     this.markControl.on('task.get.success', this, function(event, context, eventObject) {
         this.toggle(false);
     });
     this.markControl.on('task.get.none', this, function(event, context, message) {
-        this.toggle(true, message != undefined ? message : '评卷任务正在加载中', '', function() {
+        this.toggle(true, message != undefined ? message : $.i18n.prop("mark.task.loading"), '', function() {
             self.markControl.getTask();
         });
         if (context.status != undefined && context.status.totalCount == 0) {
@@ -23,7 +24,7 @@ function WarningInfo(option) {
         }
     });
     this.markControl.on('task.get.finish', this, function(event, context, message) {
-        this.toggle(true, option.finishMessage != undefined ? option.finishMessage : '评卷任务已完成');
+        this.toggle(true, option.finishMessage != undefined ? option.finishMessage : $.i18n.prop("mark.task.finish"));
         if (option.finishButtonUrl != undefined) {
             this.container.button.attr('href', option.finishButtonUrl);
             if (option.finishButtonText != undefined) {
@@ -35,7 +36,7 @@ function WarningInfo(option) {
         }
     });
     this.markControl.on('task.get.error', this, function(event, context, eventObject) {
-        this.toggle(true, option.errorMessage != undefined ? option.errorMessage : '领取评卷任务出错', '', function() {
+        this.toggle(true, option.errorMessage != undefined ? option.errorMessage : $.i18n.prop("mark.task.error"), '', function() {
             self.markControl.getTask();
         });
     });
@@ -43,16 +44,16 @@ function WarningInfo(option) {
         //this.toggle(false);
     });
     this.markControl.on('task.submit.error', this, function(event, context, eventObject) {
-        this.toggle(true, eventObject || '网络异常,任务提交失败', '关闭');
+        this.toggle(true, eventObject || $.i18n.prop("mark.network.error"), $.i18n.prop("mark.close"));
     });
     this.markControl.on('task.submit.forceSpecialTag', this, function(event, context, eventObject) {
-        this.toggle(true, '强制特殊标记已开启,至少使用一个特殊标记', '关闭');
+        this.toggle(true, $.i18n.prop("mark.force.special.tag"), $.i18n.prop("mark.close"));
     });
     this.markControl.on('history.submit.success', this, function(event, context, task) {
     	if(task.problem==true){
-    		this.toggle(true, '回评成功,已提交问题卷','关闭');
+    		this.toggle(true,$.i18n.prop("mark.history.problem") ,$.i18n.prop("mark.close"));
     	}else if(task.previous==true){
-    		this.toggle(true, '回评成功,总分:'+task.totalScore, '关闭');
+    		this.toggle(true, $.i18n.prop("mark.history.success") +task.totalScore, $.i18n.prop("mark.close"));
     	}
     });
 }
@@ -75,7 +76,7 @@ WarningInfo.prototype.toggle = function(enable, message, buttonText, callback) {
         if (buttonText != undefined && buttonText != '') {
             this.container.button.html(buttonText);
         } else {
-            this.container.button.html('请点击重试');
+            this.container.button.html($.i18n.prop("mark.try.again"));
         }
 
         this.container.button.unbind();
@@ -95,4 +96,4 @@ WarningInfo.prototype.toggle = function(enable, message, buttonText, callback) {
 }
 
 WarningInfo.prototype.container_dom = '<div class="warning-popover"><p></p>\
-<a href="#" class="btn btn-large btn-primary text-c">请点击重试</a></div>';
+<a href="#" class="btn btn-large btn-primary text-c" data-i18n-text="mark.try.again">请点击重试</a></div>';

+ 18 - 4
stmms-web/src/main/webapp/static/mark-track/js/mark-control.js

@@ -656,17 +656,17 @@ MarkControl.prototype.sidebar_dom = '<div class="mark-sidebar span2 hide"></div>
 MarkControl.prototype.center_dom = '<div class="center-content span12"></div>';
 
 MarkControl.prototype.center_header_dom = '<div class="row-fluid"><div class="header"><p class="tips">\
-<em><a href="##" class="btn" id="switch-common-button" style="display:none">切换到普通模式</a>\
-<a href="javascript:void(0)" id="assistant-button" class="btn"><i class="icon-wrench"></i> 小助手</a></em>\
+<em><a href="##" class="btn" id="switch-common-button" style="display:none" data-i18n-text="mark.mode.common">切换到普通模式</a>\
+<a href="javascript:void(0)" id="assistant-button" class="btn" data-i18n-html="mark.assistant"><i class="icon-wrench"></i> 小助手</a></em>\
 <a class="useinfo" href="#"><i class="icon-user icon-white"></i><i id="mark-user-name"></i></a>\
-<a class="logout" id="logout-link" href="{logoutUrl}"><i class="icon-off icon-white"></i> <i id="logout-title">退出</i></a>\
+<a class="logout" id="logout-link" href="{logoutUrl}"><i class="icon-off icon-white"></i> <i id="logout-title" data-i18n-text="user.logout">退出</i></a>\
 </p></div></div>';
 
 MarkControl.prototype.center_content_dom = '<div class="row-fluid"><div class="image-content span9"><nav></nav></div></div>';
 
 MarkControl.prototype.assistant_dom = '<div class="popover bottom assistant"><div class="arrow"></div></div>';
 
-MarkControl.prototype.mark_function_dom = '<h3 class="popover-title">评卷功能</h3>\
+MarkControl.prototype.mark_function_dom = '<h3 class="popover-title" data-i18n-text="mark.function">评卷功能</h3>\
 <div class="popover-content"><p id="function-list" class="popover-list">\
 </p></div>';
 
@@ -716,4 +716,18 @@ function getDom(content, markControl) {
 
 function isArray(obj) {
     return obj != undefined && Object.prototype.toString.call(obj) === '[object Array]';
+}
+function loadLanguage() {  
+	$("[data-i18n-value]").each(function() {
+		$(this).val($.i18n.prop($(this).data("i18n-value")));
+	});
+	$("[data-i18n-text]").each(function() {
+		$(this).text($.i18n.prop($(this).data("i18n-text")));
+	});
+	$("[data-i18n-html]").each(function() {
+		$(this).html($.i18n.prop($(this).data("i18n-html")));
+	});
+	$("[data-i18n-placeholder]").each(function() {
+		$(this).attr('placeholder',$.i18n.prop($(this).data("i18n-placeholder")));
+	});
 }

+ 6 - 6
stmms-web/src/main/webapp/static/mark-track/js/modules/mark-board.js

@@ -492,16 +492,16 @@ MarkBoard.prototype.onFocusChange = function() {
 }
 
 MarkBoard.prototype.step_board_dom = '<div class="span3 mark-steps"><div class="step-board">\
-    <div class="sublist"><p class="fraction">总分 <i id="total-score">5</i></p></div>\
+    <div class="sublist"><p class="fraction"data-i18n-html="mark.total.score" >总分 <i id="total-score">5</i></p></div>\
 <div class="button">\
-<input type="submit" value="全零分" class="btn1 all-zero-button"/>\
-<input type="submit" value="提&nbsp;交" class="btn2 task-submit-button"/></div>\
+<input type="submit" value="全零分" class="btn1 all-zero-button" data-i18n-value="mark.score.zero"/>\
+<input type="submit" value="提&nbsp;交" class="btn2 task-submit-button" data-i18n-value="mark.submit"/></div>\
 <div class="step-list"><div class="number"><ul></ul></div></div>\
 <div class="score_board"><div class="score"><ul></ul></div></div>\
 <div class="clear_button">\
-<input type="submit" value="回退" class="btn1 undo-last-track-button" />\
-<input type="submit" value="清除本题" class="btn1 clear-current-track-button" />\
-<!--<input type="submit" value="清除全卷" class="btn1 clear-all-track-button"/></div>-->\
+<input type="submit" value="回退" class="btn1 undo-last-track-button" data-i18n-value="mark.back"/>\
+<input type="submit" value="清除本题" class="btn1 clear-current-track-button" data-i18n-value="mark.clear.question"/>\
+<!--<input type="submit" value="清除全卷" class="btn1 clear-all-track-button" data-i18n-value="mark.clear"/></div>-->\
 </div></div>';
 
 MarkBoard.prototype.step_dom = '<li><a href="#"><p></p><h2></h2></a></li>';

+ 1 - 1
stmms-web/src/main/webapp/static/mark-track/js/modules/sheet-view.js

@@ -37,7 +37,7 @@ SheetView.prototype.render = function(urls) {
 				var content = $(this.container_dom).appendTo(this.markControl.container.centerContent);
 				this.renderContent(content, url,i);
 				this.list.push({
-				    nav: this.markControl.addNavGroup('原卷' + (i + 1), content),
+				    nav: this.markControl.addNavGroup($.i18n.prop("mark.sheet") + (i + 1), content),
 				    content: content
 				});
 			} 

+ 6 - 6
stmms-web/src/main/webapp/static/mark-track/js/modules/single-image-view.js

@@ -50,7 +50,7 @@ SingleImageView.prototype.init = function() {
     //this.container.perfectScrollbar({
     //    wheelSpeed: 20
     //});
-    this.markControl.addNavGroup('答卷', this.container);
+    this.markControl.addNavGroup($.i18n.prop("mark.student.answer"), this.container);
 
     this.canvas = this.container.find('canvas')[0];
     this.ctx = this.canvas.getContext("2d");
@@ -67,11 +67,11 @@ SingleImageView.prototype.init = function() {
     });
 
     this.imageControl = getDom(this.image_control_dom, this.markControl).insertBefore(this.markControl.container.assistantButton.parent());
-    this.imageControl.find('.zoom-out-button').click(this, function(event) {
+    this.imageControl.find('.zoom-in-button').click(this, function(event) {
         self.reloadImage(0.2);
         self.markControl.trigger('image.reload.event');
     });
-    this.imageControl.find('.zoom-in-button').click(this, function(event) {
+    this.imageControl.find('.zoom-out-button').click(this, function(event) {
         self.reloadImage(-0.2);
         self.markControl.trigger('image.reload.event');
     });
@@ -136,7 +136,7 @@ SingleImageView.prototype.drawTag = function(tag) {
 SingleImageView.prototype.container_dom = '<div style="overflow: scroll; width: 100%"><canvas></canvas></div>';
 
 SingleImageView.prototype.image_control_dom = '<em>\
-<a href="#" class="btn zoom-out-button">放大</a>\
-<a href="#" class="btn zoom-in-button">缩小</a>\
-<a href="#" class="btn zoom-fit-button">适应</a>\
+<a href="#" class="btn zoom-in-button" data-i18n-text="mark.zoom.in">放大</a>\
+<a href="#" class="btn zoom-out-button" data-i18n-text="mark.zoom.out">缩小</a>\
+<a href="#" class="btn zoom-fit-button" data-i18n-text="mark.zoom.fit">适应</a>\
 </em>';

+ 5 - 0
stmms-web/src/main/webapp/static/rich-text/css/rich-text.css

@@ -23,6 +23,11 @@
     text-decoration: underline;
 }
 
+.rich-text .text.italic {
+    font-style: italic;
+    color:red;
+}
+
 .rich-text .text.sup {
     vertical-align: super;
     font-size: 9px;

+ 1 - 1
stmms-web/src/main/webapp/static/rich-text/js/render.js

@@ -19,7 +19,7 @@ function renderSection(section,isCount) {
         }
     });
     if(isCount){
-    	html.push("(字数统计:" + count + ")")
+    	html.push('<span class="text italic">(字数统计' + count + ')</span>');
     }
     return '<p>' + html.join('') + '</p>';
 }