From: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
co-authored by: Archana Singh <archus(a)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(a)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