Skip to content

Commit bac65da

Browse files
committed
feat: add gettext support in xblock-sdk
1 parent fb2cf53 commit bac65da

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

workbench/templates/workbench/block.html

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<link rel="stylesheet" type="text/css"
66
href="{% static 'workbench/css/workbench.css' %}">
77
<script src="{% static 'workbench/js/runtime/logger.js' %}"></script>
8+
<script src="{% url 'javascript-catalog' %}"></script>
89
<script>
910
// TODO: This should be handled more modularly.
1011
studentId = '{{student_id}}';

workbench/urls.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33

44
from django.conf import settings
5+
from django.views.i18n import JavaScriptCatalog
56
from django.conf.urls.static import static
67
from django.contrib import admin
78
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
8-
from django.urls import re_path
9+
from django.urls import re_path, path
910

1011
from workbench import views
1112

@@ -61,6 +62,7 @@
6162
views.reset_state,
6263
name='reset_state'
6364
),
65+
path('jsi18n/', JavaScriptCatalog.as_view(), name='javascript-catalog'),
6466

6567
re_path(r'^admin/', admin.site.urls),
6668
]

0 commit comments

Comments
 (0)