Project

General

Profile

Statistics
| Branch: | Revision:

root / env / lib / python2.7 / site-packages / django / conf / urls / i18n.py @ 1a305335

History | View | Annotate | Download (576 Bytes)

1
from django.conf import settings
2
from django.conf.urls import patterns
3
from django.core.urlresolvers import LocaleRegexURLResolver
4

    
5
def i18n_patterns(prefix, *args):
6
    """
7
    Adds the language code prefix to every URL pattern within this
8
    function. This may only be used in the root URLconf, not in an included
9
    URLconf.
10

11
    """
12
    pattern_list = patterns(prefix, *args)
13
    if not settings.USE_I18N:
14
        return pattern_list
15
    return [LocaleRegexURLResolver(pattern_list)]
16

    
17

    
18
urlpatterns = patterns('',
19
    (r'^setlang/$', 'django.views.i18n.set_language'),
20
)