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
but django only support zh-Hant and zh-Hans
what can i do to support zh-HK zh-TW zh-CN
--
Ticket URL: <https://code.djangoproject.com/ticket/32533>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> **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
>
> but django only support zh-Hant and zh-Hans
>
> what can i do to support zh-HK zh-TW zh-CN
New description:
**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
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32533#comment:1>
Old description:
> **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
New description:
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
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32533#comment:2>
Old description:
> 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
New description:
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
--
--
Ticket URL: <https://code.djangoproject.com/ticket/32533#comment:3>
* status: new => closed
* resolution: => needsinfo
Comment:
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.
--
Ticket URL: <https://code.djangoproject.com/ticket/32533#comment:4>