  from django.utils.http import is_safe_url
  from django.utils.translation import (
      LANGUAGE_SESSION_KEY, check_for_language, get_language, to_locale,
  )
  
  DEFAULT_PACKAGES = ['django.conf']
  LANGUAGE_QUERY_PARAMETER = 'language'
  
  
 
</s> remove import gettext as gettext_module
 </s> add  </s> remove         default_translation = translation(settings.LANGUAGE_CODE)
 </s> add         if self.domain == 'django':
            # Get from cache
            default_translation = translation(settings.LANGUAGE_CODE)
        else:
            default_translation = DjangoTranslation(
                settings.LANGUAGE_CODE, domain=self.domain, localedirs=localedirs
            ) </s> remove     def __init__(self, language):
 </s> add     domain = 'django'

    def __init__(self, language, domain=None, localedirs=None): </s> remove     en_selected = locale.startswith('en')
    en_catalog_missing = True
 </s> add 
from django.utils.translation.trans_real import DjangoTranslation
  from django.utils.http import is_safe_url
  from django.utils.translation import (
      LANGUAGE_SESSION_KEY, check_for_language, get_language, to_locale,
  )
from django.utils.translation.trans_real import DjangoTranslation
  
  DEFAULT_PACKAGES = ['django.conf']
  LANGUAGE_QUERY_PARAMETER = 'language'
  
  
keep keep keep add keep keep keep keep keep
 Reused the DjangoTranslation class for the javascript_catalog view

Thanks Tim Graham and Cristiano Coelho for the reviews.
Refs #26328, #26319. 
django/views/i18n.py