here's my model.py
class Company(models.Model):
name = models.CharField(_('name'), help_text=_('This is the
help text'), max_length = 255)
logo = models.ImageField(_('logo'), upload_to = 'logo/%Y%m%d
%H%M%S')
detail = models.TextField(_('detail'), blank = True)
letterhead = models.ImageField(_('letterhead'), upload_to = 'logo/
%Y%m%d%H%M%S', blank = True)
class Admin:
pass
fields = (
(None,{
'fields': ('name','logo','detail')
}),
('Optional', {
'classes' : 'collapse',
'fields' : ('letterhead',)
}),
)
class Meta:
verbose_name = _('Company')
verbose_name_plural = _('Companies')
def __unicode__(self):
return '%s' % self.name
as you can see the field 'name', the help_text is translated, but the
'name' itself is not translated.
did i do something wrong?
Use ugettex_lazy form models
from django.utils.translation import ugettext_lazy as _
cschand
from django.db import models
from django.utils.translation import ugettext_lazy as _
--- code emmited ---
name = models.CharField(_('name'), help_text=_('This is the
help text'), max_length = 255)
--- code emmited ---
on the above code, the
[ help_text=_('This is the help text') ]
is translated.. however the _('name') is not
name = models.CharField(verbose_name=_('name'),
help_text=_('This is the
help text'), max_length = 255)
isnt verbose_name is for meta class?..
it lies on the django.po
i havent remove the
#, fuzzy
mark.. thats why its not translated
link: http://groups.google.com/group/django-users/browse_thread/thread/e8476fa11cefc2b7
Notice that the message in question is marked as "fuzzy". That means
the
translation does not quite match the source string. I cannot read
Chinese well enough to know if the string is at all close, but one
obvious difference is that the source string contains a "%d" format
marker whilst the translation contains a "%s" marker.
By default, fuzzy translations are not included in the output. A
translator has to check each one, verify it is correct (or correct it)
and remove the fuzzy comment. Then the result will be include in the
MO
file.
You may wish to update the file and submit a diff of the changes to
Trac
so that it can be committed.
Thanks for the group..