I'm not sure if is this, what you are looking for,
But I use, some like this:
forms.py:
from django.utils.translation import ugettext as _
from django.contrib.auth.models import User
from django import forms
class RegForm(forms.Form):
fname = forms.CharField(label=_('First Name'),max_length=30)
lname = forms.CharField(label=_('Last Name'),max_length=30)
.
.
.
.
.
.
.
.
As you can see, I use '_()' to identify my ids, and in my pt_BR django.po,
after running ./manage.py makemessages -l pt_BR I can see:
#: people/forms.py:19
msgid "First Name"
msgstr "Primeiro Nome"
#: people/forms.py:20
msgid "Last Name"
msgstr "Sobrenome"
Don't forget to run ./manage.py compilemessages to generate the .mo file.
On Tue, May 4, 2010 at 4:20 PM, Jacek <[email protected]> wrote:
> Well, I need to translate field names (labels) in register form
> (UserCreationForm). I have checked that django.contrib.auth.forms use
> hooks for internationalization (I mean ugettext_lazy).
> But when I run django-admin.py makemessages, my output locale file
> doesn't contain any strings from the form.
> What should I do to translate field names (labels) in UserCreationForm?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<django-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.