  
      * False = left-to-right layout
      * True = right-to-left layout
      """
      base_lang = get_language().split('-')[0]
      return base_lang in settings.LANGUAGES_BIDI
  
  
  def catalog():
      """
      Returns the current active catalog for further processing.
 
</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     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,
 </s> add     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,
    lang = get_language()
    if lang is None:
        return False
    else:
        base_lang = get_language().split('-')[0]
        return base_lang in settings.LANGUAGES_BIDI
  
      * False = left-to-right layout
      * True = right-to-left layout
      """
    lang = get_language()
    if lang is None:
        return False
    else:
        base_lang = get_language().split('-')[0]
        return base_lang in settings.LANGUAGES_BIDI
    lang = get_language()
    if lang is None:
        return False
    else:
        base_lang = get_language().split('-')[0]
        return base_lang in settings.LANGUAGES_BIDI
  
  
  def catalog():
      """
      Returns the current active catalog for further processing.
keep keep keep keep 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. 
django/utils/translation/trans_real.py