-
Notifications
You must be signed in to change notification settings - Fork 102
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
makemessages for Jinja2 fails translation lookup with trim_blocks
: true and leading newline in trans
block
#306
Comments
Hi @vaughnkoch , I've submitted a pull request that enables trim_blocks and lstrip_blocks if you set them in the TEMPLATES settings. Would you mind trying it out with your project before I release a new version of django-jinja? If there's anything I'm missing or have messed up, I'd rather find out before pushing it to PyPI.
Thanks and I hope this helps! |
Hi Philip, thanks for the quick turnaround! I tested your updated package, but I'm getting an error when running Here's a summary of the behavior:
I think the TLDR from the above is that with this new code, adding Errors:
django_jinja from ipdb:
Jinja environment:
settings.py:
Pipfile:
Pipfile.lock:
Pipenv graph output:
|
Hi, thanks for this useful library!
I'm using
django-jinja
to runmakemessages
with Jinjatrans
blocks to make a .po file for translation.I see that you've added
ext.i18n.trimmed
support - can you also add support fortrim_blocks
andlstrip_blocks
? When I use some of these settings,makemessages
doesn't strip away the newline, but Jinja does. This causes gettext to fail lookup because the .mo file has the newline baked in.Example template:
This template works in comparison:
See pallets/jinja#1925 for context.
The text was updated successfully, but these errors were encountered: