savoirfairelinux-openerp team mailing list archive
-
savoirfairelinux-openerp team
-
Mailing list archive
-
Message #01189
[Merge] lp:~savoirfairelinux-openerp/openobject-server/translate_warnings_1297525-trunk into lp:openobject-server
Sandy Carter (http://www.savoirfairelinux.com) has proposed merging lp:~savoirfairelinux-openerp/openobject-server/translate_warnings_1297525-trunk into lp:openobject-server.
Requested reviews:
OpenERP Core Team (openerp)
Related bugs:
Bug #1297525 in OpenERP Web: "Title of except_orm "Warning" is untranslatable"
https://bugs.launchpad.net/openerp-web/+bug/1297525
For more details, see:
https://code.launchpad.net/~savoirfairelinux-openerp/openobject-server/translate_warnings_1297525-trunk/+merge/212738
When searching a frame for context, the _() call looks for self.localcontext but misses self.context.
The integration of this patch allows for web warnings (such as except_orm) to be translated by _()
--
https://code.launchpad.net/~savoirfairelinux-openerp/openobject-server/translate_warnings_1297525-trunk/+merge/212738
Your team Savoir-faire Linux' OpenERP is subscribed to branch lp:~savoirfairelinux-openerp/openobject-server/translate_warnings_1297525-trunk.
=== modified file 'openerp/tools/translate.py'
--- openerp/tools/translate.py 2014-03-20 09:01:05 +0000
+++ openerp/tools/translate.py 2014-03-25 22:25:14 +0000
@@ -196,7 +196,7 @@
lang = ctx.get('lang')
s = frame.f_locals.get('self', {})
if not lang:
- c = getattr(s, 'localcontext', None)
+ c = getattr(s, 'localcontext', None) or getattr(s, 'context', None)
if c:
lang = c.get('lang')
if not lang: