Skip to content

Commit

Permalink
fix: fixup previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
OmarIthawi committed Nov 18, 2023
1 parent 35d8228 commit 2ab3272
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drag_and_drop_v2/drag_and_drop_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class DragAndDropBlock(
SOLUTION_INCORRECT: None
}

I18N_JS_NAMESPACE = 'DragAndDropI18N'
i18n_js_namespace = 'DragAndDropI18N'

display_name = String(
display_name=_("Title"),
Expand Down Expand Up @@ -338,12 +338,12 @@ def get_deprecated_i18n_js_url(self):
return text_js.format(lang_code=code)
return None

def get_i18n_js_url(self):
def get_javascript_i18n_catalog_url(self):
"""
Return the JavaScript translation file provided by the XBlockI18NService.
"""
if get_locale_static_url_func := getattr(self.i18n_service, 'get_javascript_locale_static_url', None):
return get_locale_static_url_func(self)
if url_getter_func := getattr(self.i18n_service, 'get_javascript_i18n_catalog_url', None):
return url_getter_func(self)
return None

@XBlock.supports("multi_device") # Enable this block for use in the mobile app via webview
Expand All @@ -368,7 +368,7 @@ def student_view(self, context):
for js_url in js_urls:
fragment.add_javascript_url(self.runtime.local_resource_url(self, js_url))

if static_i18n_js_url := self.get_i18n_js_url():
if static_i18n_js_url := self.get_javascript_i18n_catalog_url():
fragment.add_javascript_url(static_i18n_js_url)
elif deprecated_i18n_js_url := self.get_deprecated_i18n_js_url():
fragment.add_javascript_url(self.runtime.local_resource_url(self, deprecated_i18n_js_url))
Expand Down

0 comments on commit 2ab3272

Please sign in to comment.