Opened 6 years ago

Closed 6 years ago

Last modified 3 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 6 years ago.
Temporary fix

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by oyvind

Temporary fix

comment:1 Changed 6 years ago by oyvind

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset


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

comment:2 Changed 6 years ago by jezdez

  • Resolution set to worksforme
  • Status changed from new to closed

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

comment:3 Changed 3 years ago by anonymous

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