← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 724057] Re: translation needs context but it doesn't always exist

 

xrg, I don't agree.

1: It will not add any overhead because 99% of the cases context will
already exist. Even more, 99% of the translations happen only when
raising an exception so that means executing the code only once or twice
in the RPC call.

2: If you do not want to translate, why do you mark the text to be
translated? Even if you want that marked for some really strange
reason, why not adding context['lang'] = 'en_US' ?

Not adding this piece of code makes the referential integrity error,
which is very usual, appear always in English. I don't think that's
acceptable having already a simple patch for it.

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/724057

Title:
  translation needs context but it doesn't always exist

Status in OpenERP Server:
  Confirmed

Bug description:
  OpenERP v6:

  class GettextAlias in tools/translate.py requires a valid context
  available where _() was called. In some cases the context variable
  does not exsits or is not properly initialized. The attached patch
  provides a workarround by searching current user's language in order
  to find to which language it should translate.

  The patch is based on a Jay Vora patch provided in a v5 bug report:
  https://bugs.launchpad.net/openobject-addons/+bug/432504



References