diff options
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/applications.txt | 6 | ||||
| -rw-r--r-- | docs/ref/contrib/admin/index.txt | 2 | ||||
| -rw-r--r-- | docs/ref/contrib/flatpages.txt | 2 | ||||
| -rw-r--r-- | docs/ref/models/instances.txt | 2 | ||||
| -rw-r--r-- | docs/ref/settings.txt | 4 | ||||
| -rw-r--r-- | docs/ref/urls.txt | 2 | ||||
| -rw-r--r-- | docs/ref/validators.txt | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/docs/ref/applications.txt b/docs/ref/applications.txt index edd88ceec8..be3f554004 100644 --- a/docs/ref/applications.txt +++ b/docs/ref/applications.txt @@ -457,10 +457,10 @@ Here are some common problems that you may encounter during initialization: importing an application configuration or a models module triggers code that depends on the app registry. - For example, :func:`~django.utils.translation.ugettext()` uses the app + For example, :func:`~django.utils.translation.gettext()` uses the app registry to look up translation catalogs in applications. To translate at - import time, you need :func:`~django.utils.translation.ugettext_lazy()` - instead. (Using :func:`~django.utils.translation.ugettext()` would be a bug, + import time, you need :func:`~django.utils.translation.gettext_lazy()` + instead. (Using :func:`~django.utils.translation.gettext()` would be a bug, because the translation would happen at import time, rather than at each request depending on the active language.) diff --git a/docs/ref/contrib/admin/index.txt b/docs/ref/contrib/admin/index.txt index d858a5741d..1cc52250ec 100644 --- a/docs/ref/contrib/admin/index.txt +++ b/docs/ref/contrib/admin/index.txt @@ -860,7 +860,7 @@ subclass:: from datetime import date from django.contrib import admin - from django.utils.translation import ugettext_lazy as _ + from django.utils.translation import gettext_lazy as _ class DecadeBornListFilter(admin.SimpleListFilter): # Human-readable title which will be displayed in the diff --git a/docs/ref/contrib/flatpages.txt b/docs/ref/contrib/flatpages.txt index 33d408a2b8..0e801a9a71 100644 --- a/docs/ref/contrib/flatpages.txt +++ b/docs/ref/contrib/flatpages.txt @@ -186,7 +186,7 @@ registering a custom ``ModelAdmin`` for ``FlatPage``:: from django.contrib import admin from django.contrib.flatpages.admin import FlatPageAdmin from django.contrib.flatpages.models import FlatPage - from django.utils.translation import ugettext_lazy as _ + from django.utils.translation import gettext_lazy as _ # Define a new FlatPageAdmin class FlatPageAdmin(FlatPageAdmin): diff --git a/docs/ref/models/instances.txt b/docs/ref/models/instances.txt index 5510105ccb..3077a22ef2 100644 --- a/docs/ref/models/instances.txt +++ b/docs/ref/models/instances.txt @@ -261,7 +261,7 @@ access to more than a single field:: import datetime from django.core.exceptions import ValidationError from django.db import models - from django.utils.translation import ugettext_lazy as _ + from django.utils.translation import gettext_lazy as _ class Article(models.Model): ... diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index e379dc19f4..2dd7e57588 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1748,11 +1748,11 @@ to restrict language selection to a subset of the Django-provided languages. If you define a custom :setting:`LANGUAGES` setting, you can mark the language names as translation strings using the -:func:`~django.utils.translation.ugettext_lazy` function. +:func:`~django.utils.translation.gettext_lazy` function. Here's a sample settings file:: - from django.utils.translation import ugettext_lazy as _ + from django.utils.translation import gettext_lazy as _ LANGUAGES = [ ('de', _('German')), diff --git a/docs/ref/urls.txt b/docs/ref/urls.txt index c4ff8f7b90..d44cce80da 100644 --- a/docs/ref/urls.txt +++ b/docs/ref/urls.txt @@ -34,7 +34,7 @@ Helper function to return a URL pattern for serving files in debug mode:: ] The ``regex`` parameter should be a string or -:func:`~django.utils.translation.ugettext_lazy()` (see +:func:`~django.utils.translation.gettext_lazy()` (see :ref:`translating-urlpatterns`) that contains a regular expression compatible with Python's :py:mod:`re` module. Strings typically use raw string syntax (``r''``) so that they can contain sequences like ``\d`` without the need to diff --git a/docs/ref/validators.txt b/docs/ref/validators.txt index 635f76d1eb..50badc7222 100644 --- a/docs/ref/validators.txt +++ b/docs/ref/validators.txt @@ -16,7 +16,7 @@ different types of fields. For example, here's a validator that only allows even numbers:: from django.core.exceptions import ValidationError - from django.utils.translation import ugettext_lazy as _ + from django.utils.translation import gettext_lazy as _ def validate_even(value): if value % 2 != 0: |
