[Bugfix][MD310][bug-view-1251][login] Probability of error message when changing login password
Change-Id: Ie4fc60be71201c613b133ebb2c1ccd763e508d58
diff --git a/lynq/R307L/ap/app/zte_webui/js/com.js b/lynq/R307L/ap/app/zte_webui/js/com.js
index e486c75..e71609a 100755
--- a/lynq/R307L/ap/app/zte_webui/js/com.js
+++ b/lynq/R307L/ap/app/zte_webui/js/com.js
@@ -1,4 +1,5 @@
+
define("service","underscore jquery set CryptoJS".split(" "), function (_, $, config, CryptoJS) {
function addTimerSomething(querys, cb) {
if (_.isArray(querys)) {
@@ -6457,6 +6458,32 @@
init:init
}
});
+
+const errorMessages = {
+ "en": {
+ txtCurrent: {
+ manage_info_check: "Please enter a valid password."
+ },
+ txtNew: {
+ manage_info_check: "Please enter a valid password."
+ },
+ txtConfirm: {
+ equalTo: "The new password and the confirmed password do not match or contain illegal characters."
+ }
+ },
+ "zh": {
+ txtCurrent: {
+ manage_info_check: "请输入有效的密码"
+ },
+ txtNew: {
+ manage_info_check: "请输入有效的密码"
+ },
+ txtConfirm: {
+ equalTo: "新密码和确认密码不匹配或者包含非法字符"
+ }
+ }
+};
+
// �������� �
define("adm_management","jquery knockout set service underscore CryptoJS".split(" "),
@@ -6574,6 +6601,12 @@
var fwVm = new manageViewModel();
ko.applyBindings(fwVm, container[0]);
+ const userLanguage = navigator.language || navigator.userLanguage;
+ // Extract language code,"en", "zh"
+ const langCode = userLanguage.split('-')[0];
+ // If there is no matching language, English is used by default
+ const messages = errorMessages[langCode] || errorMessages["en"];
+
$('#frmPassword').validate({
submitHandler:function () {
fwVm.changeValue();
@@ -6582,7 +6615,8 @@
txtCurrent:"manage_info_check",
txtNew:"manage_info_check",
txtConfirm:{ equalTo:"#txtNew"}
- }
+ },
+ messages: messages
});
}