#1066 closed defect (fixed)
Lost import of i18n stuffs in defaultfilters
| Reported by: | Ivan Fedorov | Owned by: | Adrian Holovaty | 
|---|---|---|---|
| Component: | Core (Other) | Version: | dev | 
| Severity: | major | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description
Lost import of i18n stuffs in defaultfilters.
But it used in "yesno" filter.
Attachments (1)
Change History (4)
by , 20 years ago
| Attachment: | defaultfilters.py.diff added | 
|---|
comment:1 by , 20 years ago
| Resolution: | → fixed | 
|---|---|
| Status: | new → closed | 
comment:2 by , 20 years ago
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 by , 20 years ago
ok. you right.
I'm only want use Django for my work... my solution is bad, but works for me... thanks for right way. :)
fix for bug