Changeset 915
- Timestamp:
- 10/17/05 14:34:12 (3 years ago)
- Files:
-
- django/branches/i18n/docs/translation.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/i18n/docs/translation.txt
r885 r915 86 86 template rendering in the admin. 87 87 88 There is a standard problem with translations, that is pluralization of 88 If you don't like the verbose name gettext_lazy, you can just alias it as _ - in the model 89 file you will allways use lazy translations anyway. And it's a good idea to add translations 90 for the field names and table names, too. This means writing explicit verbose_name and 91 verbose_names options in the META subclass, though:: 92 93 from django.utils.translation import gettext_lazy as _ 94 95 class Mything(meta.Model): 96 97 name = meta.CharField(_('Name'), help_text=_('This is the help text')) 98 99 class META: 100 101 verbose_name = _('Mything') 102 verbose_name_plural = _('Mythings') 103 104 There is another standard problem with translations, that is pluralization of 89 105 strings. This is done by the standard helper ngettext like so:: 90 106 … … 200 216 201 217 The format for the explicit django_language parameters is allways the 202 l ocale to use - for example it's pt_BRfor Brazilian. If a base language218 language to use - for example it's pt-br for Brazilian. If a base language 203 219 is available, but the sublanguage specified is not, the base language is used. 204 For example if you specify de _AT(Austrian German), but there is only a220 For example if you specify de-at (Austrian German), but there is only a 205 221 language de available, that language is used. 206 222
