[Kimchi-devel] [PATCH] [Wok] Seperate method to get accept-language.
Jose Ricardo Ziviani
joserz at linux.vnet.ibm.com
Mon Apr 18 13:17:50 UTC 2016
Reviewed by: Jose Ricardo Ziviani <joserz at linux.vnet.ibm.com>
On 18-04-2016 07:05, archus at linux.vnet.ibm.com wrote:
> From: Archana Singh <archus at 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 at 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
>
>
--
Jose Ricardo Ziviani
-----------------------------
Software Engineer
Linux Technology Center - IBM
More information about the Kimchi-devel
mailing list