[Kimchi-devel] [Wok][PATCH 2/7] Multi-Culture support - Add methods to get and set locales in wok.lang.js

pkulkark at linux.vnet.ibm.com pkulkark at linux.vnet.ibm.com
Wed May 4 05:57:12 UTC 2016


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

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

This patch adds separate methods to
get the locale from cookies (if set)
and to set the locale.

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

diff --git a/ui/js/src/wok.lang.js b/ui/js/src/wok.lang.js
index b3791e7..e62753d 100644
--- a/ui/js/src/wok.lang.js
+++ b/ui/js/src/wok.lang.js
@@ -46,6 +46,14 @@ wok.lang = {
             'en_US';
     },
 
+    get_loc: function() {
+        return wok.cookie.get('wokLocale') || 'en-US';
+    },
+
+    set_loc: function(loc) {
+        wok.cookie.set('wokLocale', loc, 365);
+    },
+
     set: function(lang) {
         wok.cookie.set('wokLang', lang, 365);
     }
-- 
2.1.0




More information about the Kimchi-devel mailing list