Changeset 5324
- Timestamp:
- 05/23/07 21:20:34 (2 years ago)
- Files:
-
- django/branches/unicode/docs/i18n.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/unicode/docs/i18n.txt
r5280 r5324 71 71 Specify a translation string by using the function ``ugettext()``. Since you 72 72 may 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 ``_()``). 73 alias and ``_`` is a very common choice. 75 74 76 75 .. note:: … … 81 80 1. For international character set (unicode) support, you really wanting 82 81 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. 86 86 87 87 2. Python's interactive shell uses ``_`` to represent "the previous … … 183 183 name = models.CharField(help_text=_('This is the help text')) 184 184 185 Always use lazy translations in `Django models`_. And it's a good idea to add185 Always use lazy translations in `Django models`_. It's a good idea to add 186 186 translations for the field names and table names, too. This means writing 187 187 explicit ``verbose_name`` and ``verbose_name_plural`` options in the ``Meta``
