Allow the use of translation.override as a decorator
I think it would be nice if translation.override
could be used as a decorator.
Although a comment in https://code.djangoproject.com/ticket/16690#comment:2 suggested this was not useful, I have experienced several cases where it is. For instance, I have some functions which are sending mail and I want those mails to be translated in some default language which is not the one of the user doing the action. Having the function decorated is better in terms of readability than a long with
statement which introduces heavy indentation.
Change History
(5)
Cc: |
Simon Charette added
|
Triage Stage: |
Unreviewed → Accepted
|
Triage Stage: |
Accepted → Ready for checkin
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Here is my pull request for this feature: https://github.com/django/django/pull/3088