Opened 4 years ago

Last modified 4 years ago

#32533 closed Uncategorized

i18n l10n set the Accept-Language but always get settings.LANGUAGE_CODE — at Version 2

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

there's one more thing

in chinese language
browser will set Accept-Language zh-HK zh-TW zh-CN (test in chrome 88.0.4324.192)

but django only support zh-Hant and zh-Hans

what can i do to support zh-HK zh-TW zh-CN

Change History (2)

comment:1 by iwmbm, 4 years ago

Description: modified (diff)

comment:2 by iwmbm, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top