Skip to main content

i18n_patterns

Add the language code prefix to every URL pattern within this function. This may only be used in the root URLconf, not in an included URLconf.

def i18n_patterns(
*urls: tuple,
prefix_default_language: boolean = True
) - > list

Add the language code prefix to every URL pattern within this function. This may only be used in the root URLconf, not in an included URLconf.

Parameters

NameTypeDescription
*urlstupleA sequence of URL patterns or included URLconfs to be prefixed with language codes.
prefix_default_languageboolean = TrueDetermines whether the language prefix should be prepended to the default language's URLs.

Returns

TypeDescription
listA list of URL resolvers wrapped with a locale prefix pattern if internationalization is enabled, otherwise the original URL list.