  from django.utils.safestring import SafeBytes, SafeString, SafeText, mark_safe
  from django.utils.six import PY3
  from django.utils.translation import (
      LANGUAGE_SESSION_KEY, activate, check_for_language, deactivate,
      get_language, get_language_from_request, get_language_info, gettext,
      gettext_lazy, ngettext_lazy, npgettext, npgettext_lazy, pgettext,
      pgettext_lazy, string_concat, to_locale, trans_real, ugettext,
      ugettext_lazy, ungettext, ungettext_lazy,
  )
  
  from .forms import CompanyForm, I18nForm, SelectDateForm
  from .models import Company, TestModel
  
 
</s> remove     if not language_code_re.search(lang_code):
 </s> add     if lang_code is None or not language_code_re.search(lang_code): </s> remove     base_lang = get_language().split('-')[0]
    return base_lang in settings.LANGUAGES_BIDI
 </s> add     lang = get_language()
    if lang is None:
        return False
    else:
        base_lang = get_language().split('-')[0]
        return base_lang in settings.LANGUAGES_BIDI
    get_language, get_language_bidi, get_language_from_request,
    get_language_info, gettext, gettext_lazy, ngettext_lazy, npgettext,
    npgettext_lazy, pgettext, pgettext_lazy, string_concat, to_locale,
    trans_real, ugettext, ugettext_lazy, ungettext, ungettext_lazy,
  from django.utils.safestring import SafeBytes, SafeString, SafeText, mark_safe
  from django.utils.six import PY3
  from django.utils.translation import (
      LANGUAGE_SESSION_KEY, activate, check_for_language, deactivate,
    get_language, get_language_bidi, get_language_from_request,
    get_language_info, gettext, gettext_lazy, ngettext_lazy, npgettext,
    npgettext_lazy, pgettext, pgettext_lazy, string_concat, to_locale,
    trans_real, ugettext, ugettext_lazy, ungettext, ungettext_lazy,
    get_language, get_language_bidi, get_language_from_request,
    get_language_info, gettext, gettext_lazy, ngettext_lazy, npgettext,
    npgettext_lazy, pgettext, pgettext_lazy, string_concat, to_locale,
    trans_real, ugettext, ugettext_lazy, ungettext, ungettext_lazy,
    get_language, get_language_bidi, get_language_from_request,
    get_language_info, gettext, gettext_lazy, ngettext_lazy, npgettext,
    npgettext_lazy, pgettext, pgettext_lazy, string_concat, to_locale,
    trans_real, ugettext, ugettext_lazy, ungettext, ungettext_lazy,
    get_language, get_language_bidi, get_language_from_request,
    get_language_info, gettext, gettext_lazy, ngettext_lazy, npgettext,
    npgettext_lazy, pgettext, pgettext_lazy, string_concat, to_locale,
    trans_real, ugettext, ugettext_lazy, ungettext, ungettext_lazy,
  )
  
  from .forms import CompanyForm, I18nForm, SelectDateForm
  from .models import Company, TestModel
  
keep keep keep keep replace replace replace replace keep keep keep keep keep
 Fixed #24569 -- Made some translation functions accept None value

get_language() can return None when translations are deactivated.
Thanks Nicola Peduzzi for the reporti and Tim Graham for the review. 
tests/i18n/tests.py