[Kimchi-devel] [Wok][PATCH v2 5/7] Multi-Culture support : Implement new drop down list for locale in wok.login.js

pkulkark at linux.vnet.ibm.com pkulkark at linux.vnet.ibm.com
Thu May 5 07:02:27 UTC 2016


From: Pooja Kulkarni <pkulkark at linux.vnet.ibm.com>

co-authored by: Archana Singh <archus at linux.vnet.ibm.com>

v2:
Modified call to fetch and set locales

v1:
This patch implements the new drop down
list for locale selection in wok.login.js

Signed-off-by: Pooja Kulkarni <pkulkark at linux.vnet.ibm.com>
---
 ui/js/src/wok.login.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/ui/js/src/wok.login.js b/ui/js/src/wok.login.js
index f8eed3a..437e97d 100644
--- a/ui/js/src/wok.login.js
+++ b/ui/js/src/wok.login.js
@@ -25,11 +25,20 @@ wok.login_main = function() {
     $('.filter-option').parent().attr('title',$('#userLang option[value="'+selectedLanguage+'"]').text());
     $('.filter-option').text($('#userLang option[value="'+selectedLanguage+'"]').text());
 
+    var selectedLocale = wok.lang.get_locale();
+    $('#userLocale').val(selectedLocale);
+    $('#userLocale option[value="'+selectedLocale+'"]').attr("selected", "selected");
+    $('.filter-option').attr('title',$('#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") {
-- 
2.1.0




More information about the Kimchi-devel mailing list