#NEWLINE# def reverse( viewname , urlconf = None , args = None , kwargs = None , prefix = None , force_locale = False , locale = None ) : #NEWLINE# #INDENT# "Wraps Django's reverse to prepend the correct locale.\n\n    force_locale -- Ordinarily, if get_url_prefixer() returns None, we return\n        an unlocalized URL, which will be localized via redirect when visited.\n        Set force_locale to True to force the insertion of a default locale\n        when there is no set prefixer. If you are writing a test and simply\n        wish to avoid LocaleURLMiddleware's initial 301 when passing in an\n        unprefixed URL, it is probably easier to substitute LocalizingClient\n        for any uses of django.test.client.Client and forgo this kwarg.\n\n    locale -- By default, reverse prepends the current locale (if set) or\n        the default locale if force_locale == True. To override this behavior\n        and have it prepend a different locale, pass in the locale parameter\n        with the desired locale. When passing a locale, the force_locale is\n        not used and is implicitly True.\n\n    " #NEWLINE# if locale : #NEWLINE# #INDENT# prefixer = Prefixer ( locale = locale ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# prefixer = get_url_prefixer ( ) #NEWLINE# if ( ( not prefixer ) and force_locale ) : #NEWLINE# #INDENT# prefixer = Prefixer ( ) #NEWLINE# #UNINDENT# #UNINDENT# if prefixer : #NEWLINE# #INDENT# prefix = ( prefix or '/' ) #NEWLINE# #UNINDENT# url = django_reverse ( viewname , urlconf , args , kwargs , prefix ) #NEWLINE# if prefixer : #NEWLINE# #INDENT# return prefixer . fix ( url ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return url