Django

Code

Changeset 915

Show
Ignore:
Timestamp:
10/17/05 14:34:12 (3 years ago)
Author:
hugo
Message:

i18n: updated translation doc to reflect the django_language and LANGUAGE_CODE format change

Files:

Legend:

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

    r885 r915  
    8686template rendering in the admin. 
    8787 
    88 There is a standard problem with translations, that is pluralization of 
     88If you don't like the verbose name gettext_lazy, you can just alias it as _ - in the model 
     89file you will allways use lazy translations anyway. And it's a good idea to add translations 
     90for the field names and table names, too. This means writing explicit verbose_name and 
     91verbose_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 
     104There is another standard problem with translations, that is pluralization of 
    89105strings. This is done by the standard helper ngettext like so:: 
    90106 
     
    200216 
    201217The format for the explicit django_language parameters is allways the 
    202 locale to use - for example it's pt_BR for Brazilian. If a base language 
     218language to use - for example it's pt-br for Brazilian. If a base language 
    203219is 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 a 
     220For example if you specify de-at (Austrian German), but there is only a 
    205221language de available, that language is used. 
    206222