Attendees |
---|
...
Braden recommends if someone wants to try implementing a native (iOS or Anroid) XBlock frontend, do it for poll or survey:
Code: https://github.com/open-craft/xblock-poll
Native API docs: https://github.com/open-craft/xblock-poll#api-for-native-mobile-frontends
...
- Setting up 1-click, Regis's: J'aime O, Cliff Dyer, Régis Behmo
- Xblock: poll running against localhost: José Antonio Gonzalez, J'aime O, Albert (AJ) St. Aubin (Deactivated), Cliff Dyer, Régis Behmo
- The process for extracting django template translations for an XBlock and building fake eo translation is still quite manual, and this would be a great thing to fix . Ideally we'd have an "xblock-extract-strings" script or similar, or change the edx-i18n-tools script to work with xblocks as well as edx-platform code
- See the JS fix to cookiecutter https://github.com/edx/cookiecutter-xblock/pull/4 for inspiratio
- Bryan Wilson, Jillian Vogel (Deactivated), Julia Eskew (Deactivated)
- Xblock native against poll: José Antonio Gonzalez, J'aime O, Albert (AJ) St. Aubin (Deactivated)
- Xblock web against poll: Amir Tadrisi, Rocio Aramberri
- API demo, follow-up documentation: Braden MacDonald
- Accessibility direction
...
- If your XBlock renders its UI using Django templates:
- You need to use xblock-utils 1.1.1 or higher:
- The code that implements i18n for django templates is https://github.com/edx/xblock-utils/pull/48 and https://github.com/edx/xblock-utils/pull/49
- If you use master or any release post this PR, you have it already
- In order for an XBlock's template strings to be translated, the XBlock must:
- Require the
i18n
service, see e.g. xblock-drag-and-drop-v2@XBlock.needs('i18n') class MyXBlock(XBlock): ...
- Render templates using
ResourceLoader.render_django_template
, passing thei18n
service, e.g.:def studio_view(self, context): fragment = Fragment() fragment.add_content(loader.render_django_template('/templates/html/studio_edit.html', i18n_service=self.runtime.service(self, 'i18n'))
- In the HTML template, load the
i18n
template tags:{% load i18n %}
- Mark translatable strings using the
trans
andblocktrans
tags, as described in the Django documentation. - Extract and generate the translation
.po
and.mo
files in your XBlock'stranslations
directory, as described in the XBlock tutorial.
- Require the
- You need to use xblock-utils 1.1.1 or higher:
- If your XBlock renders its UI using strings defined in Javascript:
- OpenCraft implemented a fix to django-statici18n which you need: https://github.com/zyegfryed/django-statici18n/pull/41
- It's now included in django-statici18n v1.7.1, but edx-platform master is currently using 1.4.0 so you need to bump that: https://github.com/edx/edx-platform/pull/18302
- We have a PR waiting for review that adds the code you need to the XBlock cookie cutter repo: https://github.com/edx/cookiecutter-xblock/pull/4
- Example of using that in an XBlock: https://github.com/edx-solutions/xblock-drag-and-drop-v2/pull/156
- OpenCraft implemented a fix to django-statici18n which you need: https://github.com/zyegfryed/django-statici18n/pull/41
- The process for extracting django template translations and building a fake po translation for an XBlock is still quite manual, and this would be a great thing to fix
- See the JS fix to cookiecutter https://github.com/edx/cookiecutter-xblock/pull/4 for inspiration