Opened 3 years ago

Closed 3 years ago

#33514 closed Cleanup/optimization (fixed)

Fallback to a more generic language variant for Select2 translations.

Reported by: David Glenck Owned by: Mohamed Nabil Rady
Component: contrib.admin Version: 4.0
Severity: Normal Keywords: select2
Cc: Mohamed Nabil Rady Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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 .

Attachments (1)

0001-fallback-to-language-without-region.patch (829 bytes ) - added by David Glenck 3 years ago.
patch with the suggested change

Download all attachments as: .zip

Change History (5)

by David Glenck, 3 years ago

patch with the suggested change

comment:1 by Mariusz Felisiak, 3 years ago

Has patch: unset
Keywords: select2 added
Summary: Fallback to language without region for select2 translationFallback to a more generic language variant for Select2 translations.
Triage Stage: UnreviewedAccepted
Type: BugCleanup/optimization
UI/UX: unset

Thanks for the report. We should check all variants, see e.g. get_supported_language_variant().

comment:2 by Mohamed Nabil Rady, 3 years ago

Cc: Mohamed Nabil Rady added
Has patch: set
Owner: changed from nobody to Mohamed Nabil Rady
Status: newassigned

comment:3 by Mariusz Felisiak, 3 years ago

Triage Stage: AcceptedReady for checkin

comment:4 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

Resolution: fixed
Status: assignedclosed

In 3079133:

Fixed #33514 -- Added fallbacks to subsequent language codes in Select2 translations.

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