Opened 17 years ago
Closed 17 years ago
#4813 closed (fixed)
Strange behaviour on locale using fastcgi and method=prefork
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
During using manage.py runfcgi method=prefork there is a strange behaviour, propably connected with gettext cache - random requests serve untranslated string. With method=threaded everything is ok. I hacked utils/translation/trans_real.py file for my own needed and it works:
def gettext(message): """ This function will be patched into the builtins module to provide the _ helper function. It will use the current thread as a discriminator to find the translation object to use. If no current translation is activated, the message will be run through the default translation object. """ from django.conf import settings _default = translation(settings.LANGUAGE_CODE) return _default.gettext(message)
Change History (6)
comment:1 by , 17 years ago
Version: | 0.96 → SVN |
---|
comment:2 by , 17 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 17 years ago
I wonder if this is a symptom of the same problem as #4796? Not sure they're dupes yet, but problems in the i18n code not being applied uniformly is a common feature.
comment:4 by , 17 years ago
comment:6 by , 17 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Given the lack of response or confirmation in over four months, I'm going to close this. Can be reopened if somebody can repeat the problem with a recent subversion checkout.
Looking at the comment and the use of _default, this isn't version 0.96 code at all. It's something more recent. Changing the version string.
The above change won't work in general, since it assumes you only ever want to use settings.LANGUAGE_CODE. It also wallpapers over whatever the real problem might be. I have no idea what the root cause is at the moment, though. Needs more investigation.