From: Archana Singh <archus(a)linux.vnet.ibm.com>
Seperated method to get the accept-langauage,
which can be used if format of number/timestamp has
to be done based on it.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
src/wok/template.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/wok/template.py b/src/wok/template.py
index 09f4dbe..b47041a 100644
--- a/src/wok/template.py
+++ b/src/wok/template.py
@@ -34,6 +34,12 @@ def get_lang():
if "wokLang" in cookie.keys():
return [cookie["wokLang"].value]
+ langs = get_accept_language()
+
+ return langs
+
+
+def get_accept_language():
lang = cherrypy.request.headers.get("Accept-Language", "en_US")
if lang and lang.find(';') != -1:
@@ -46,7 +52,6 @@ def get_lang():
langCountry = val.split('-')
langCountry[1] = langCountry[1].upper()
langs[idx] = "_".join(langCountry)
-
return langs
--
2.5.0