Code review comment for lp:~camptocamp/openerp-product-attributes/7.0-fix-translate-view-lep

Revision history for this message
Alexandre Fayolle - camptocamp (alexandre-fayolle-c2c) wrote :

LGTM.

Maybe the (small) duplication could be avoided by using an intermediate class:

class Translator(object):
   def __init__(cr, context):
       self.cr = cr
       self.context = context

   def __call__(self, source):
       return translate(self.cr, None, 'view', self.context.get('lang'), source) or source

and then instantiate translate_view = Translator(cr, context), and call translate_view where needed.

review: Needs Information

« Back to merge proposal