Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#1066 closed defect (fixed)

Lost import of i18n stuffs in defaultfilters

Reported by: Ivan Fedorov Owned by: Adrian Holovaty
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 Ivan Fedorov 11 years ago.
fix for bug

Download all attachments as: .zip

Change History (4)

Changed 11 years ago by Ivan Fedorov

Attachment: defaultfilters.py.diff added

fix for bug

comment:1 Changed 11 years ago by hugo

Resolution: fixed
Status: newclosed

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

comment:2 Changed 11 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 11 years ago by Ivan Fedorov

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