
From: Archana Singh <archus@linux.vnet.ibm.com> Sets select lang and locale selected in login page. Signed-off-by: Archana Singh <archus@linux.vnet.ibm.com> co-authored by: Pooja Kulkarni <pkulkark@linux.vnet.ibm.com> --- ui/js/src/wok.login.js | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/ui/js/src/wok.login.js b/ui/js/src/wok.login.js index f8eed3a..7423f81 100644 --- a/ui/js/src/wok.login.js +++ b/ui/js/src/wok.login.js @@ -22,14 +22,25 @@ wok.login_main = function() { var selectedLanguage = wok.lang.get(); $('#userLang').val(selectedLanguage); $('#userLang option[value="'+selectedLanguage+'"]').attr("selected", "selected"); - $('.filter-option').parent().attr('title',$('#userLang option[value="'+selectedLanguage+'"]').text()); - $('.filter-option').text($('#userLang option[value="'+selectedLanguage+'"]').text()); + $('.filter-option:first').parent().attr('title',$('#userLang option[value="'+selectedLanguage+'"]').text()); + $('.filter-option:first').text($('#userLang option[value="'+selectedLanguage+'"]').text()); + + var selectedLocale = wok.lang.get_locale(); + $('#userLocale').val(selectedLocale); + $('#userLocale option[value="'+selectedLocale+'"]').attr("selected", "selected"); + $('.filter-option:last').parent().attr('title',$('#userLocale option[value="'+selectedLocale+'"]').text()); + $('.filter-option:last').text($('#userLocale option[value="'+selectedLocale+'"]').text()); + $('#userLang').on('change', function() { wok.lang.set($(this).val()); location.reload(); }); + $('#userLocale').on('change', function() { + wok.lang.set_locale($(this).val()); + }); + var query = window.location.search; var error = /.*error=(.*?)(&|$)/g.exec(query); if (error && error[1] === "sessionTimeout") { -- 1.8.3.1