diff options
| author | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-24 02:20:34 +0000 |
|---|---|---|
| committer | Malcolm Tredinnick <malcolm.tredinnick@gmail.com> | 2007-05-24 02:20:34 +0000 |
| commit | fbce6f6bdc9b2c2f71bf4324d9b3c0b92aee12cb (patch) | |
| tree | e0f60e9e86126678d838401ce9148b169580e006 /docs | |
| parent | 3989feed0c79544aba298e4c9ce77d7562268557 (diff) | |
unicode: Made some small tweaks to the i18n docs. The whole file could do with
a rewrite, though, I suspect.
git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5324 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/i18n.txt | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/i18n.txt b/docs/i18n.txt index 41092c3a96..d8edaef615 100644 --- a/docs/i18n.txt +++ b/docs/i18n.txt @@ -70,8 +70,7 @@ Standard translation Specify a translation string by using the function ``ugettext()``. Since you may well be typing this a lot, it's often worthwhile importing it as a shorter -alias and ``_`` is a very common choice (i.e. the function is called as -``_()``). +alias and ``_`` is a very common choice. .. note:: Python's standard library ``gettext`` module installs ``_()`` into the @@ -80,9 +79,10 @@ alias and ``_`` is a very common choice (i.e. the function is called as 1. For international character set (unicode) support, you really wanting to be using ``ugettext()``, rather than ``gettext()``. Sometimes, you - should be using ``ugettext_lazy()`` more often. By not installing - ``_`` directly, the developer is required to think about which is the - most appropriate function to use. + should be using ``ugettext_lazy()`` as the default translation method + for a particular file. By not installing ``_`` directly, the + developer has to think about which is the most appropriate function + to use. 2. Python's interactive shell uses ``_`` to represent "the previous result". This is also used in doctest tests and having ``_()`` causes @@ -182,7 +182,7 @@ If you don't like the verbose name ``ugettext_lazy``, you can just alias it as class MyThing(models.Model): name = models.CharField(help_text=_('This is the help text')) -Always use lazy translations in `Django models`_. And it's a good idea to add +Always use lazy translations in `Django models`_. It's a good idea to add translations for the field names and table names, too. This means writing explicit ``verbose_name`` and ``verbose_name_plural`` options in the ``Meta`` class, though:: |
