Opened 8 years ago

Closed 8 years ago

Last modified 5 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


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'}


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 8 years ago.
Temporary fix

Download all attachments as: .zip

Change History (4)

Changed 8 years ago by oyvind

Attachment: nb_nn_fix.diff added

Temporary fix

comment:1 Changed 8 years ago by oyvind


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

comment:2 Changed 8 years ago by Jannis Leidel

Resolution: worksforme
Status: newclosed

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

comment:3 Changed 5 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