Exemplo n.º 1
0
 def i18n_patterns(*args):
     warnings.warn(
         "As of Django 1.10, fnpdjango.utils.urls.i18n_patterns "
         "is deprecated in favor of directly using "
         "django.urls.i18n_patterns(prefix_default_language=False).",
         DeprecationWarning)
     return django_i18n_patterns(*args, prefix_default_language=False)
Exemplo n.º 2
0
def i18n_patterns(*args):
    """
    We want to avoid having to change anything in the projects
    root urls.py when new versions of Django are released.
    """
    use_prefix = getattr(settings, 'PREFIX_DEFAULT_LANGUAGE', True)
    return django_i18n_patterns(*args, prefix_default_language=use_prefix)
Exemplo n.º 3
0
def i18n_patterns(*args):
    """
    compatibility shim for i18n_patterns. In django 1.8 the prefix argument
    was deprecated and will be removed in 1.10. We want to avoid having to
    change anything in the projects root urls.py when new versions of Django
    are released.
    """
    return django_i18n_patterns('', *args)
Exemplo n.º 4
0
def i18n_patterns(*args):
    """
    compatibility shim for i18n_patterns. In django 1.8 the prefix argument
    was deprecated and will be removed in 1.10. We want to avoid having to
    change anything in the projects root urls.py when new versions of Django
    are released.
    """
    if getattr(settings, 'PREFIX_DEFAULT_LANGUAGE', True):
        return django_i18n_patterns('', *args)
    return list(args)