code: def get_language():
      
      lang = _get_language()
      if lang is None:  # Django >= 1.8
          return settings.DEFAULT_LANGUAGE
      if lang not in settings.AVAILABLE_LANGUAGES and '-' in lang:
          lang = lang.split('-')[0]
      if lang in settings.AVAILABLE_LANGUAGES:
          return lang
      return settings.DEFAULT_LANGUAGE
docs: Return an active language code that is guaranteed to be in
      settings.LANGUAGES (Django does not seem to guarantee this for us).