MCPcopy
hub / github.com/django/django / i18n_patterns

Function i18n_patterns

django/conf/urls/i18n.py:8–20  ·  view source on GitHub ↗

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.

(*urls, prefix_default_language=True)

Source from the content-addressed store, hash-verified

6
7
8def i18n_patterns(*urls, prefix_default_language=True):
9 """
10 Add the language code prefix to every URL pattern within this function.
11 This may only be used in the root URLconf, not in an included URLconf.
12 """
13 if not settings.USE_I18N:
14 return list(urls)
15 return [
16 URLResolver(
17 LocalePrefixPattern(prefix_default_language=prefix_default_language),
18 list(urls),
19 )
20 ]
21
22
23@functools.cache

Callers 11

urls.pyFile · 0.90
urls.pyFile · 0.90
wrong.pyFile · 0.90
disabled.pyFile · 0.90
wrong_namespace.pyFile · 0.90
default.pyFile · 0.90
urls_i18n.pyFile · 0.90
http.pyFile · 0.90

Calls 2

URLResolverClass · 0.90
LocalePrefixPatternClass · 0.90

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…