Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#1066 closed defect (fixed)

Lost import of i18n stuffs in defaultfilters

Reported by: oxyum Owned by: adrian
Component: Core (Other) Version: master
Severity: major Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Lost import of i18n stuffs in defaultfilters.

But it used in "yesno" filter.

Attachments (1)

defaultfilters.py.diff (431 bytes) - added by oxyum 9 years ago.
fix for bug

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by oxyum

fix for bug

comment:1 Changed 9 years ago by hugo

  • Resolution set to fixed
  • Status changed from new to closed

(In [1673]) fixes #1066 - yesno used the wrong way to do translations

comment:2 Changed 9 years ago by hugo

There was no import missing - the "_" is available in the global namespace (the builtins). But the problem with it was that it used the wrong way - it used eager translation in a definition. I didn't use the gettext_lazy, as that - even though it works - usually is only the second-best solution (and is mostly restricted to the validators and models). Instead I do eager translation in the function itself by using the gettext function directly. yesno now correctly switches it's translation according to the current active language.

comment:3 Changed 9 years ago by oxyum

ok. you right.

I'm only want use Django for my work... my solution is bad, but works for me... thanks for right way. :)

Note: See TracTickets for help on using tickets.
Back to Top