From ef57b74daa485331b9e726f6f192086666e9eb65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20G=C3=B3rny?= <bartek@gorny.edu.pl> Date: Mon, 12 Nov 2007 08:53:28 +0000 Subject: [PATCH] let lang be passed explicitly (not in **kw) git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17524 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Type/patches/Localizer.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/product/ERP5Type/patches/Localizer.py b/product/ERP5Type/patches/Localizer.py index b5baa9da30..c2a24da34e 100644 --- a/product/ERP5Type/patches/Localizer.py +++ b/product/ERP5Type/patches/Localizer.py @@ -35,7 +35,7 @@ except ImportError: pass -def Localizer_translate(self, domain, msgid, mapping=None, *args, **kw): +def Localizer_translate(self, domain, msgid, lang=None, mapping=None, *args, **kw): """ This translate() method use Localizer and support catalog aliases. """ @@ -58,6 +58,8 @@ def Localizer_translate(self, domain, msgid, mapping=None, *args, **kw): for key in ('lang', 'add', 'default'): if key in kw: params[key] = kw[key] + if lang is not None: + params['lang'] = lang if 'target_language' in kw: params['lang'] = kw['target_language'] translated_str = catalog_obj.gettext(msgid, **params) -- 2.30.9