[saem-devel] [PATCH sherpa] Fix forcing language to french in http-negociation mode

Sylvain Thénault sylvain.thenault at logilab.fr
Wed Feb 22 08:06:37 CET 2017


applied


Le 21/02/2017 à 17:19, Philippe Pepiot a écrit :
> # HG changeset patch
> # User Philippe Pepiot <philippe.pepiot at logilab.fr>
> # Date 1487693861 -3600
> #      Tue Feb 21 17:17:41 2017 +0100
> # Node ID 14ef164d7ac68505c3ec3adf974efa90586588a3
> # Parent  f3d5feaf0c2665977750bd665e728d6c662d1e4f
> # Available At https://hg.logilab.org/review/cubes/sherpa
> #              hg pull https://hg.logilab.org/review/cubes/sherpa -r 14ef164d7ac6
> Fix forcing language to french in http-negociation mode
>
> The previous monkeypatch wasn't working since set_user_language() was dropped
> in cubicweb 3.24
>
> diff --git a/site_cubicweb.py b/site_cubicweb.py
> --- a/site_cubicweb.py
> +++ b/site_cubicweb.py
> @@ -20,5 +20,5 @@ from cubicweb.web import request
>  
>  
>  @monkeypatch(request._CubicWebRequestBase)
> -def set_user_language(self, user):
> -    self.set_language('fr')
> +def negotiated_language(self):
> +    return 'fr'
> _______________________________________________
> saem-devel mailing list
> saem-devel at lists.cubicweb.org
> http://lists.cubicweb.org/mailman/listinfo/saem-devel

-- 
Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42)
Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations
Développement logiciel sur mesure:       http://www.logilab.fr/services
CubicWeb, the semantic web framework:    http://www.cubicweb.org



More information about the saem-devel mailing list