[Bugfix][MD310][bug-view-1251][login] Probability of error message when changing login password
Change-Id: Ie4fc60be71201c613b133ebb2c1ccd763e508d58
diff --git a/lynq/MD310/ap/app/zte_webui/js/com.js b/lynq/MD310/ap/app/zte_webui/js/com.js
index 608b424..fb439bb 100755
--- a/lynq/MD310/ap/app/zte_webui/js/com.js
+++ b/lynq/MD310/ap/app/zte_webui/js/com.js
@@ -6491,6 +6491,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(" "),
@@ -6608,6 +6634,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();
@@ -6616,7 +6648,8 @@
txtCurrent:"manage_info_check",
txtNew:"manage_info_check",
txtConfirm:{ equalTo:"#txtNew"}
- }
+ },
+ messages: messages
});
}