def strip_language_code(request):
 path = request.path
 if (settings.USE_I18N and hasattr(request, 'LANGUAGE_CODE')):
  return re.sub(('^/%s/' % request.LANGUAGE_CODE), '/', path)
 return path

def strip_language_code ( request ) : path = request . path if ( settings . USE_I18N and hasattr ( request , 'LANGUAGE_CODE' ) ) : return re . sub ( ( '^/%s/' % request . LANGUAGE_CODE ) , '/' , path ) return path
when using djangos i18n_patterns .