From c32ecf29427bfe79dbaa5be83127e2a234746d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Fri, 16 May 2014 19:59:06 +0200 Subject: [PATCH] [enh] Retrieve and set locale in the api --- moulinette/interfaces/api.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/moulinette/interfaces/api.py b/moulinette/interfaces/api.py index 69e5d61e..81f3630d 100644 --- a/moulinette/interfaces/api.py +++ b/moulinette/interfaces/api.py @@ -162,6 +162,12 @@ class _ActionsMapPlugin(object): context -- An instance of Route """ + try: + # Attempt to retrieve and set locale + m18n.set_locale(request.params.pop('locale')) + except: + pass + def wrapper(*args, **kwargs): # Bring arguments together params = kwargs