[Django] #32533: i18n l10n set the Accept-Language but always get settings.LANGUAGE_CODE

18 views
Skip to first unread message

Django

unread,
Mar 9, 2021, 8:36:15 PM3/9/21
to django-...@googlegroups.com
#32533: i18n l10n set the Accept-Language but always get settings.LANGUAGE_CODE
-----------------------------------------+---------------------------
Reporter: iwmbm | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.1
Severity: Normal | Keywords: i18n,l10n
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+---------------------------
**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

--
Ticket URL: <https://code.djangoproject.com/ticket/32533>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 9, 2021, 8:39:17 PM3/9/21
to django-...@googlegroups.com
#32533: i18n l10n set the Accept-Language but always get settings.LANGUAGE_CODE
-------------------------------+--------------------------------------

Reporter: iwmbm | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.1
Severity: Normal | Resolution:

Keywords: i18n,l10n | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by iwmbm:

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>

Django

unread,
Mar 9, 2021, 8:39:50 PM3/9/21
to django-...@googlegroups.com
#32533: i18n l10n set the Accept-Language but always get settings.LANGUAGE_CODE
-------------------------------+--------------------------------------

Reporter: iwmbm | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.1
Severity: Normal | Resolution:

Keywords: i18n,l10n | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by iwmbm:

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>

Django

unread,
Mar 9, 2021, 8:53:04 PM3/9/21
to django-...@googlegroups.com
#32533: i18n l10n set the Accept-Language but always get settings.LANGUAGE_CODE
-------------------------------+--------------------------------------

Reporter: iwmbm | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 3.1
Severity: Normal | Resolution:

Keywords: i18n,l10n | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Description changed by iwmbm:

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>

Django

unread,
Mar 9, 2021, 9:03:30 PM3/9/21
to django-...@googlegroups.com
#32533: i18n l10n set the Accept-Language but always get settings.LANGUAGE_CODE
-------------------------------+--------------------------------------
Reporter: iwmbm | Owner: nobody
Type: Uncategorized | Status: closed
Component: Uncategorized | Version: 3.1
Severity: Normal | Resolution: needsinfo

Keywords: i18n,l10n | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tim Graham):

* 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>

Reply all
Reply to author
Forward
0 new messages