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

Philippe Pepiot philippe.pepiot at logilab.fr
Tue Feb 21 17:19:14 CET 2017


# 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'



More information about the saem-devel mailing list