Django

Code

Changeset 5324

Show
Ignore:
Timestamp:
05/23/07 21:20:34 (2 years ago)
Author:
mtredinnick
Message:

unicode: Made some small tweaks to the i18n docs. The whole file could do with
a rewrite, though, I suspect.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/unicode/docs/i18n.txt

    r5280 r5324  
    7171Specify a translation string by using the function ``ugettext()``. Since you 
    7272may well be typing this a lot, it's often worthwhile importing it as a shorter 
    73 alias and ``_`` is a very common choice (i.e. the function is called as 
    74 ``_()``). 
     73alias and ``_`` is a very common choice. 
    7574 
    7675.. note:: 
     
    8180      1. For international character set (unicode) support, you really wanting 
    8281         to be using ``ugettext()``, rather than ``gettext()``. Sometimes, you 
    83          should be using ``ugettext_lazy()`` more often. By not installing 
    84          ``_`` directly, the developer is required to think about which is the 
    85          most appropriate function to use. 
     82         should be using ``ugettext_lazy()`` as the default translation method 
     83         for a particular file. By not installing ``_`` directly, the 
     84         developer has to think about which is the most appropriate function 
     85         to use. 
    8686 
    8787      2. Python's interactive shell uses ``_`` to represent "the previous 
     
    183183        name = models.CharField(help_text=_('This is the help text')) 
    184184 
    185 Always use lazy translations in `Django models`_. And it's a good idea to add 
     185Always use lazy translations in `Django models`_. It's a good idea to add 
    186186translations for the field names and table names, too. This means writing 
    187187explicit ``verbose_name`` and ``verbose_name_plural`` options in the ``Meta``