Opened 7 years ago

Closed 7 years ago

Last modified 4 years ago

#13575 closed Uncategorized (worksforme)

nb/nn locale not a valid python locale

Reported by: oyvind Owned by: nobody
Component: Internationalization Version: master
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 7 years ago.
Temporary fix

Download all attachments as: .zip

Change History (4)

Changed 7 years ago by oyvind

Attachment: nb_nn_fix.diff added

Temporary fix

comment:1 Changed 7 years ago by oyvind

Correction:

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

comment:2 Changed 7 years ago by Jannis Leidel

Resolution: worksforme
Status: newclosed

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

http://gist.github.com/407493

comment:3 Changed 4 years ago by anonymous

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