-
Notifications
You must be signed in to change notification settings - Fork 26
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
PDF translation support, and write XML using buffer #1849
Conversation
indigo_api/exporters.py
Outdated
@@ -205,7 +210,11 @@ def insert_frontmatter(self, document): | |||
""" Generates the frontmatter and inserts it before the body (and coverpage if present) in the XML. | |||
The document's document_xml isn't updated. | |||
""" | |||
# explicitly set the document's language for e.g. numbered title to be translated | |||
activate(document.django_language) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather user override()
which ensures the deactivate is called if there is an error:
with override(document.django_language):
frontmatter = ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks!
indigo_api/exporters.py
Outdated
with open(xml_file, "wb") as f: | ||
f.write(xml.encode('utf-8')) | ||
# use io.open, BytesIO, getbuffer to avoid XML parse error in production | ||
with io.open(xml_file, "wb") as f: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you link to the issue this is trying to solve? I don't see how this change will fix anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No description provided.