Skip to content

Commit

Permalink
fix localizations (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyLykhoman authored and Igor Degtiarov committed Oct 29, 2018
1 parent c9cc482 commit 4cebf9f
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
12 changes: 10 additions & 2 deletions pdf/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ def student_view(self, context=None):
'source_url': self.source_url,
'_i18n_service': self.i18n_service
}
html = self.render_template('templates/html/pdf_view.html', context)
html = loader.render_django_template(
'templates/html/pdf_view.html',
context=context,
i18n_service=self.i18n_service,
)

event_type = 'edx.pdf.loaded'
event_data = {
Expand All @@ -130,7 +134,11 @@ def studio_view(self, context=None):
'source_text': self.source_text,
'source_url': self.source_url
}
html = self.render_template('templates/html/pdf_edit.html', context)
html = loader.render_django_template(
'templates/html/pdf_edit.html',
context=context,
i18n_service=self.i18n_service,
)
frag = Fragment(html)
frag.add_javascript(self.load_resource("static/js/pdf_edit.js"))
frag.initialize_js('pdfXBlockInitEdit')
Expand Down
2 changes: 1 addition & 1 deletion pdf/templates/html/pdf_view.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<h2>{% trans display_name %} </h2>
<object data="{{ url }}" type="application/pdf" width="100%" height="600">
<p>
{% trans "You do not seem to have enough to view a PDF in your browser ..." %}
{% trans "It appears you don't have a PDF plugin for this browser." %}
</p>
</object>
{% if allow_download or source_url != "" %}
Expand Down
Binary file modified pdf/translations/ar/LC_MESSAGES/text.mo
Binary file not shown.
Binary file modified pdf/translations/pt_BR/LC_MESSAGES/text.mo
Binary file not shown.
4 changes: 2 additions & 2 deletions pdf/translations/pt_BR/LC_MESSAGES/text.po
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ msgid "http://tutorial.math.lamar.edu/pdf/Trig_Cheat_Sheet.pdf"
msgstr "http://tutorial.math.lamar.edu/pdf/Trig_Cheat_Sheet.pdf"

#: pdf/pdf.py:40 pdf/static/html/pdf_edit.html:18
msgid "The URL for your PDF."
msgstr "A URL para o seu PDF"
msgid "The URL of the PDF file"
msgstr "O URL para o seu arquivo PDF"

#: pdf/pdf.py:42 pdf/static/html/pdf_edit.html:23
msgid "PDF Download Allowed"
Expand Down

0 comments on commit 4cebf9f

Please sign in to comment.