Commit ef57b74d authored by Bartek Górny's avatar Bartek Górny

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
parent b6a7b3b8
...@@ -35,7 +35,7 @@ except ImportError: ...@@ -35,7 +35,7 @@ except ImportError:
pass 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. This translate() method use Localizer and support catalog aliases.
""" """
...@@ -58,6 +58,8 @@ def Localizer_translate(self, domain, msgid, mapping=None, *args, **kw): ...@@ -58,6 +58,8 @@ def Localizer_translate(self, domain, msgid, mapping=None, *args, **kw):
for key in ('lang', 'add', 'default'): for key in ('lang', 'add', 'default'):
if key in kw: if key in kw:
params[key] = kw[key] params[key] = kw[key]
if lang is not None:
params['lang'] = lang
if 'target_language' in kw: if 'target_language' in kw:
params['lang'] = kw['target_language'] params['lang'] = kw['target_language']
translated_str = catalog_obj.gettext(msgid, **params) translated_str = catalog_obj.gettext(msgid, **params)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment