def _default_locale_fallback(request, document_slug, document_locale):
 fallback_doc = None
 redirect_url = None
 fallback_reason = None
 try:
  fallback_doc = Document.objects.get(locale=settings.WIKI_DEFAULT_LANGUAGE, slug=document_slug)
  translation = fallback_doc.translated_to(document_locale)
  if (translation and translation.current_revision):
   url = translation.get_absolute_url()
   redirect_url = urlparams(url, query_dict=request.GET)
  elif (translation and fallback_doc.current_revision):
   fallback_reason = 'translation_not_approved'
  elif fallback_doc.current_revision:
   fallback_reason = 'no_translation'
 except Document.DoesNotExist:
  pass
 return (fallback_doc, fallback_reason, redirect_url)

def _default_locale_fallback ( request , document_slug , document_locale ) : fallback_doc = None redirect_url = None fallback_reason = None try : fallback_doc = Document . objects . get ( locale = settings . WIKI_DEFAULT_LANGUAGE , slug = document_slug ) translation = fallback_doc . translated_to ( document_locale ) if ( translation and translation . current_revision ) : url = translation . get_absolute_url ( ) redirect_url = urlparams ( url , query_dict = request . GET ) elif ( translation and fallback_doc . current_revision ) : fallback_reason = 'translation_not_approved' elif fallback_doc . current_revision : fallback_reason = 'no_translation' except Document . DoesNotExist : pass return ( fallback_doc , fallback_reason , redirect_url )
if were falling back to a document in the default locale .