Ticket #33514: 0001-fallback-to-language-without-region.patch

File 0001-fallback-to-language-without-region.patch, 829 bytes (added by David Glenck, 3 years ago)

patch with the suggested change

  • widgets.py

    From c74e5e886dd8b108035e49c4bba23e7808281e6f Mon Sep 17 00:00:00 2001
    Date: Mon, 14 Feb 2022 22:48:29 +0100
    Subject: [PATCH] fallback to language without region
    
    ---
     widgets.py | 3 ++-
     1 file changed, 2 insertions(+), 1 deletion(-)
    
    diff --git a/widgets.py b/widgets.py
    index f1002ca..a084c07 100644
    a b class AutocompleteMixin:  
    388388        self.db = using
    389389        self.choices = choices
    390390        self.attrs = {} if attrs is None else attrs.copy()
    391         self.i18n_name = SELECT2_TRANSLATIONS.get(get_language())
     391        self.i18n_name = SELECT2_TRANSLATIONS.get(get_language()) or \
     392                         SELECT2_TRANSLATIONS.get(get_language().split('-')[0])
    392393
    393394    def get_url(self):
    394395        return reverse(self.url_name % self.admin_site.name)
Back to Top