Yeah, I think I have solved this problem myself.
I should use ugettext_lazy here.

On Friday, December 20, 2013 3:55:35 PM UTC+8, Chang Sun wrote:
>
> Hi, everyone!
>
> I add placeholder attrs to forms.TextInput so it can show in html5
>         widget=forms.TextInput(attrs={'placeholder':
>                                       _('Username or Email')}),
>
> However, once I run manage.py runserver and request any web page using one 
> language, then the translation is *always* translated to this language 
> even when I choose other languages.
>
> Other gettext variables are OK as I choose other languages.
> For example:
>             self.helper.layout = Layout(
>                 Field('username_email'),
>                 Field('password'),
>                 Submit('submit', _('Sign in')),
>             )
> _('Sign in') will be translated to different languages on the fly.
>
> Anyone has any ideas about this problem?
>
> I would appreciate any suggestions.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/8d031877-09c9-482e-850e-391574c2010f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to