#13575 closed Uncategorized (worksforme)
nb/nn locale not a valid python locale
Reported by: | oyvind | Owned by: | nobody |
---|---|---|---|
Component: | Internationalization | Version: | dev |
Severity: | Normal | Keywords: | locale python nb nn norwegian nynorsk |
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
If this code is run in the django shell:
from django.utils.translation.trans_real import get_language_from_request g = get_language_from_request from django.http import HttpRequest r = HttpRequest() r.COOKIES = {} r.META = {'HTTP_ACCEPT_LANGUAGE': 'nb,nn;q=0.7,en;q=0.3'} g(r)
The returned language code is "en".
The reason for this is that neither "no" or "nn" is in locale.locale_alias.
Attaching temporary fix.
Attachments (1)
Change History (4)
by , 14 years ago
Attachment: | nb_nn_fix.diff added |
---|
comment:1 by , 14 years ago
Correction:
The reason for this is that neither "nb" or "nn" is in locale.locale_alias.
comment:2 by , 14 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
Can't reproduce this, probably missing locales in the OS.
comment:3 by , 12 years ago
Easy pickings: | set |
---|---|
Severity: | → Normal |
Type: | → Uncategorized |
UI/UX: | unset |
Note:
See TracTickets
for help on using tickets.
Temporary fix