Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

django-bootstrap3 ignores request.LANGUAGE_CODE #38

Closed
proft opened this issue Nov 14, 2013 · 4 comments
Closed

django-bootstrap3 ignores request.LANGUAGE_CODE #38

proft opened this issue Nov 14, 2013 · 4 comments

Comments

@proft
Copy link

proft commented Nov 14, 2013

Hello!

I have Django==1.5.4 and django-bootstrap3==2.0.0 and multilingual site.
All chunks in template translated successfully except form generated by django-bootstrap3. It's label not translated. In templates text ramains as in form defination ...

@dyve
Copy link
Member

dyve commented Feb 28, 2014

How do you translate your form? Do you have verbose_name in your models and/or form labels (you should) or do you usually translate labels in your templates (you shouldn’t)?

@adriaant
Copy link

Indeed, use something like:

from django.utils.translation import ugettext_lazy as _

foo = models.ForeignKey(Foo, related_name='bar', blank=True, null=True, verbose_name=_("foo"))

@proft
Copy link
Author

proft commented Mar 15, 2014

Yes, I found the solution - change ugettext to ugettext_lazy. Thanks for response.

@proft proft closed this as completed Mar 15, 2014
@dyve
Copy link
Member

dyve commented Mar 16, 2014

Thank you for your feedback @proft!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants