mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-7293: UI: Fixed localization issues on the login page
- Reverted the validator.messages to the original values (jquery.validator.js).
- Added a function to localize validator.messages which is called before login.
Signed-off-by: Brian Federle <brian.federle@citrix.com>
(cherry picked from commit f212aa57c3)
Signed-off-by: Rohit Yadav <rohit.yadav@shapeblue.com>
Conflicts:
ui/scripts/cloudStack.js
This commit is contained in:
parent
fa300f9f5e
commit
eb6987c393
|
|
@ -474,8 +474,6 @@
|
|||
loginArgs.hideLoginScreen = true;
|
||||
}
|
||||
|
||||
cloudStack.uiCustom.login(loginArgs);
|
||||
|
||||
// Localization
|
||||
if (!$.isFunction(cloudStack.localizationFn)) { // i.e., localize is overridden by a plugin/module
|
||||
cloudStack.localizationFn = function(str) {
|
||||
|
|
@ -483,6 +481,11 @@
|
|||
};
|
||||
}
|
||||
|
||||
document.title = _l('label.app.name');
|
||||
// Localize validation messages
|
||||
cloudStack.localizeValidatorMessages();
|
||||
|
||||
cloudStack.uiCustom.login(loginArgs);
|
||||
|
||||
document.title = _l('label.app.name');
|
||||
});
|
||||
})(cloudStack, jQuery);
|
||||
|
|
|
|||
|
|
@ -120,4 +120,29 @@
|
|||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Localize validator messages
|
||||
*/
|
||||
cloudStack.localizeValidatorMessages = function() {
|
||||
$.extend($.validator.messages, {
|
||||
required: _l('message.validate.fieldrequired'),
|
||||
remote: _l('message.validate.fixfield'),
|
||||
email: _l('message.validate.email.address'),
|
||||
url: _l('message.validate.URL'),
|
||||
date: _l('message.validate.date'),
|
||||
dateISO: _l('message.validate.date.ISO'),
|
||||
number: _l('message.validate.number'),
|
||||
digits: _l('message.validate.digits'),
|
||||
creditcard: _l('message.validate.creditcard'),
|
||||
equalTo: _l('message.validate.equalto'),
|
||||
accept: _l('message.validate.accept'),
|
||||
maxlength: $.validator.format(_l('message.validate.maxlength')),
|
||||
minlength: $.validator.format(_l('message.validate.minlength')),
|
||||
rangelength: $.validator.format(_l('message.validate.range.length')),
|
||||
range: $.validator.format(_l('message.validate.range')),
|
||||
max: $.validator.format(_l('message.validate.max')),
|
||||
min: $.validator.format(_l('messgae.validate.min'))
|
||||
});
|
||||
};
|
||||
})(jQuery, cloudStack);
|
||||
|
|
|
|||
Loading…
Reference in New Issue