[saem-devel] [PATCH saem_ref] Force language to french in http-negociation mode

Philippe Pepiot philippe.pepiot at logilab.fr
Tue Feb 21 17:23:53 CET 2017


# HG changeset patch
# User Philippe Pepiot <philippe.pepiot at logilab.fr>
# Date 1487693269 -3600
#      Tue Feb 21 17:07:49 2017 +0100
# Node ID a3f7ef5825c98aeb695a3404e337c5e34ef39229
# Parent  ce2a74e6ac634a14e58c61205d0386db904853c6
# Available At https://hg.logilab.org/review/cubes/saem_ref
#              hg pull https://hg.logilab.org/review/cubes/saem_ref -r a3f7ef5825c9
# Tested at https://jenkins.logilab.org/job/cubicweb-saem_ref/82/
Force language to french in http-negociation mode

diff --git a/cubicweb_saem_ref/site_cubicweb.py b/cubicweb_saem_ref/site_cubicweb.py
--- a/cubicweb_saem_ref/site_cubicweb.py
+++ b/cubicweb_saem_ref/site_cubicweb.py
@@ -25,6 +25,7 @@ from cubicweb import cwvreg, _
 from cubicweb.cwconfig import register_persistent_options
 from cubicweb.uilib import PRINTERS
 from cubicweb.entity import Entity
+from cubicweb.web import request
 
 from cubes.skos import rdfio
 from cubes.skos.ccplugin import ImportSkosData
@@ -204,3 +205,8 @@ def is_hook_category_activated(self, cat
     if self._hooks_mode is session.HOOKS_DENY_ALL:
         return category in self._hooks_categories
     return category not in self._hooks_categories
+
+
+ at monkeypatch(request._CubicWebRequestBase)
+def negotiated_language(self):
+    return 'fr'



More information about the saem-devel mailing list