Opened 16 years ago
Closed 13 years ago
#11118 closed Bug (fixed)
BaseCommand doesn't restore translation
Reported by: | rvdrijst | Owned by: | nobody |
---|---|---|---|
Component: | Core (Management commands) | Version: | dev |
Severity: | Normal | Keywords: | basecommand execute syncdb translation testing |
Cc: | rvdrijst@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
The implementation of BaseCommand.execute() sets the translation to 'en-us' for the duration of the command execution, but doesn't restore the original translation. This is not a problem when execution stops when the command is done (command line use)
However in tests, the syncdb command is called programmatically, running the tests with the 'en-us' translation activated even when this is not the same as settings.LANGUAGE_CODE.
The attached patch fixes this by restoring the language that was activated when the command started.
Note: this ticket is related to #10078, but whereas that ticket is about documentation, this ticket fixes a bug.
Attachments (2)
Change History (7)
by , 16 years ago
Attachment: | basecommand.diff added |
---|
comment:1 by , 15 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 14 years ago
Needs tests: | set |
---|---|
Severity: | → Normal |
Type: | → Bug |
comment:3 by , 13 years ago
Component: | Core (Other) → Core (Management commands) |
---|---|
Easy pickings: | unset |
Needs tests: | unset |
UI/UX: | unset |
comment:4 by , 13 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
patch with fix (restore translation)