[Django] #33514: Fallback to language without region for select2 translation

18 views
Skip to first unread message

Django

unread,
Feb 14, 2022, 4:53:46 PM2/14/22
to django-...@googlegroups.com
#33514: Fallback to language without region for select2 translation
-----------------------------------------+------------------------
Reporter: David Glenck | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 1 |
-----------------------------------------+------------------------
When using for example the setting `LANGUAGE_CODE="de-ch"`, the
autocomplete_field widget will be in English as select2 does not provide
the specific regional translation for "de-ch". However the existing
translation language "de" would be a much better approximation.

I suggest using the language without region from the LANGUAGE_CODE in case
an exact match can not be found.

This is __not__ a duplicate of https://code.djangoproject.com/ticket/33070
.

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

Django

unread,
Feb 14, 2022, 4:54:26 PM2/14/22
to django-...@googlegroups.com
#33514: Fallback to language without region for select2 translation
-------------------------------+--------------------------------------

Reporter: David Glenck | Owner: nobody
Type: Bug | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------+--------------------------------------
Changes (by David Glenck):

* Attachment "0001-fallback-to-language-without-region.patch" added.

patch with the suggested change

Django

unread,
Feb 15, 2022, 12:20:26 AM2/15/22
to django-...@googlegroups.com
#33514: Fallback to a more generic language variant for Select2 translations.
--------------------------------------+------------------------------------

Reporter: David Glenck | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: select2 | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Mariusz Felisiak):

* keywords: => select2
* has_patch: 1 => 0
* ui_ux: 1 => 0
* type: Bug => Cleanup/optimization
* stage: Unreviewed => Accepted


Comment:

Thanks for the report. We should check all variants, see e.g.
[https://github.com/django/django/blob/7986028e3fbc9f84fca5a25a03cecfbc85ca5ce7/django/utils/translation/trans_real.py#L506-L508
get_supported_language_variant()].

--
Ticket URL: <https://code.djangoproject.com/ticket/33514#comment:1>

Django

unread,
Feb 17, 2022, 8:45:55 PM2/17/22
to django-...@googlegroups.com
#33514: Fallback to a more generic language variant for Select2 translations.
-------------------------------------+-------------------------------------
Reporter: David Glenck | Owner: Mohamed
Type: | Nabil Rady
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.0

Severity: Normal | Resolution:
Keywords: select2 | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mohamed Nabil Rady):

* cc: Mohamed Nabil Rady (added)
* owner: nobody => Mohamed Nabil Rady
* has_patch: 0 => 1
* status: new => assigned


Comment:

https://github.com/django/django/pull/15438

--
Ticket URL: <https://code.djangoproject.com/ticket/33514#comment:2>

Django

unread,
Feb 18, 2022, 2:38:39 AM2/18/22
to django-...@googlegroups.com
#33514: Fallback to a more generic language variant for Select2 translations.
-------------------------------------+-------------------------------------
Reporter: David Glenck | Owner: Mohamed
Type: | Nabil Rady
Cleanup/optimization | Status: assigned
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution:
Keywords: select2 | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/33514#comment:3>

Django

unread,
Feb 18, 2022, 7:00:32 AM2/18/22
to django-...@googlegroups.com
#33514: Fallback to a more generic language variant for Select2 translations.
-------------------------------------+-------------------------------------
Reporter: David Glenck | Owner: Mohamed
Type: | Nabil Rady
Cleanup/optimization | Status: closed
Component: contrib.admin | Version: 4.0
Severity: Normal | Resolution: fixed

Keywords: select2 | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"3079133c73f3b8b0e929673b06b62dce1f54be71" 3079133]:
{{{
#!CommitTicketReference repository=""
revision="3079133c73f3b8b0e929673b06b62dce1f54be71"
Fixed #33514 -- Added fallbacks to subsequent language codes in Select2
translations.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/33514#comment:4>

Reply all
Reply to author
Forward
0 new messages