#32272: gettext_lazy inconsistent error when nested
--------------------------------------+------------------------------------
     Reporter:  John Bazik            |                    Owner:  nobody
         Type:  Bug                   |                   Status:  new
    Component:  Internationalization  |                  Version:  3.1
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by John Bazik):

 Here is another solution.

 If {{{gettext_lazy}}} was defined in {{{trans_real.py}}} (it is not now),
 then it could be set in {{{translation/__init__.py}}} like this

 {{{
 def gettext_lazy(message):
     return _trans.gettext_lazy(message)
 }}}

 Then {{{lazy}}} would never get called when it isn't needed.

 That would require moving some or all of the lazy stuff from
 {{{__init__.py}}} to {{{trans_real.py}}} which is more work.  And there's
 a lot going on in {{{trans_real.py}}} already.

 Another possibility is to apply {{{lazy}}} in {{{Trans.__getattr__}}}, in
 {{{__init__.py}}}, where USE_I18N is tested.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32272#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/064.30e285b9412628caf1d40ee506629fd8%40djangoproject.com.

Reply via email to