def get_language_from_path(path, supported=None):
 if (supported is None):
  from django.conf import settings
  supported = dict(settings.LANGUAGES)
 regex_match = language_code_prefix_re.match(path)
 if regex_match:
  lang_code = regex_match.group(1)
  if ((lang_code in supported) and check_for_language(lang_code)):
   return lang_code

def get_language_from_path ( path , supported = None ) : if ( supported is None ) : from django . conf import settings supported = dict ( settings . LANGUAGES ) regex_match = language_code_prefix_re . match ( path ) if regex_match : lang_code = regex_match . group ( 1 ) if ( ( lang_code in supported ) and check_for_language ( lang_code ) ) : return lang_code
returns the language-code if there is a valid language-code found in the path .