Opened 15 years ago

Closed 15 years ago

Last modified 12 years ago

#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)

nb_nn_fix.diff (689 bytes ) - added by oyvind 15 years ago.
Temporary fix

Download all attachments as: .zip

Change History (4)

by oyvind, 15 years ago

Attachment: nb_nn_fix.diff added

Temporary fix

comment:1 by oyvind, 15 years ago

Correction:

The reason for this is that neither "nb" or "nn" is in locale.locale_alias.

comment:2 by Jannis Leidel, 15 years ago

Resolution: worksforme
Status: newclosed

Can't reproduce this, probably missing locales in the OS.

http://gist.github.com/407493

comment:3 by anonymous, 12 years ago

Easy pickings: set
Severity: Normal
Type: Uncategorized
UI/UX: unset
Note: See TracTickets for help on using tickets.
Back to Top