-
Notifications
You must be signed in to change notification settings - Fork 45
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
Translations don't work #30
Comments
Yes, I wrote the same. All works fine if run as "manage.py runserver". File "/home/shop/shop/settings.py", line 295, in <module>
jingo.env.install_gettext_translations(translation)
AttributeError: 'module' object has no attribute 'env' But project running and works. |
I work around this. I have gettext installation in the file of my private app jingoi18n/init.py |
I try putting initialization code in settings.py already, same exception. |
It looks like that exception has to do with
How are you importing jingo in settings.py? |
setttings.py: import jingo.monkey
jingo.monkey.patch()
try:
from django.utils import translation
from jingo.import env
env.install_gettext_translations(translation)
except:
pass |
import jingo
jingo.env.install_gettext_translations(translation) |
Just tried. Same errror: jingo.env.install_gettext_translations(translation)
AttributeError: 'module' object has no attribute 'env' |
Can anyone who ran into this try with Jingo 0.8? There are some changes (there's no |
Hi,
jingo without any extra configuration doesn't translate texts in templates. In documentation isn't any notice about this behaviour. Issue arise because jingo in default config install null translation in jinja2 enviroment (https://github.com/jbalogh/jingo/blob/master/jingo/__init__.py#L70).
For resolving issue you must install gettext translation:
Comment before
install_null_translations()
says that call is important for testing, so we should choose cautious solution. May be create some optional setting for these cases and definitely write down documentation.The text was updated successfully, but these errors were encountered: