Opened 19 years ago
Closed 16 years ago
#3907 closed (fixed)
LocaleMiddleware allows locale from user browser that don't exists in settings.py
| Reported by: | Owned by: | nobody | |
|---|---|---|---|
| Component: | Internationalization | Version: | dev |
| Severity: | Keywords: | locale browser | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | yes | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
LocaleMiddleware allows locale from user browser that don't exists in settings.py of the project.
More details in: http://groups.google.com/group/django-users/browse_thread/thread/57181b3407383e6c/7e06278858e2007b
Attachments (2)
Change History (5)
comment:1 by , 19 years ago
| Has patch: | set |
|---|---|
| Keywords: | browser added |
| Needs tests: | set |
comment:2 by , 19 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
Hi Nuno, can you attach a patch of the above changes? (svn diff > output.diff) this makes it much easier for us to plug in and use :)
by , 19 years ago
| Attachment: | trans_real.py added |
|---|
Patch for disabling locate from client browser to be loaded if doesn't exists in settings.py
by , 19 years ago
| Attachment: | trans_real.py.diff added |
|---|
I think is that you want. Sorry, I'm new to svn.
A simple patch is to accept the mainlang(if supported) if the lang is not supported:
File: django/utils/translation/real_trans.py
[...] def get_language_from_request(request): [...] for lang, mainlang, order in langs: if lang in supported or mainlang in supported: # If the lang is not supported but mainlang is, than activate mainlang if not lang in supported and mainlang in supported: lang = mainlang [...]