Opened 4 years ago

Closed 4 years ago

#32533 closed Uncategorized (needsinfo)

i18n l10n set the Accept-Language but always get settings.LANGUAGE_CODE

Reported by: iwmbm Owned by: nobody
Component: Uncategorized Version: 3.1
Severity: Normal Keywords: i18n, l10n
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by iwmbm)

Hello, everyone!

settings.py

LANGUAGE_CODE = 'zh-hant'

MIDDLEWARE = [
    ...
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.locale.LocaleMiddleware',
    'django.middleware.common.CommonMiddleware',
    ...
]

browser request headers
Accept-Language:Accept-Language: en,en-US;q=0.9,de;q=0.8

i try to get request.LANGUAGE_CODE but always return zh-hant

Change History (4)

comment:1 by iwmbm, 4 years ago

Description: modified (diff)

comment:2 by iwmbm, 4 years ago

Description: modified (diff)

comment:3 by iwmbm, 4 years ago

Description: modified (diff)

comment:4 by Tim Graham, 4 years ago

Resolution: needsinfo
Status: newclosed

Hi, I don't think you've explained the issue in enough detail to confirm a bug in Django. Please reopen the ticket if you can debug your issue and provide details about why and where Django is at fault. If you're having trouble understanding how Django works, see TicketClosingReasons/UseSupportChannels for ways to get help.

Note: See TracTickets for help on using tickets.
Back to Top