From 2ab32727f6b2a2607439c2c8d99bed2e06287ee2 Mon Sep 17 00:00:00 2001 From: Omar Al-Ithawi Date: Sat, 18 Nov 2023 10:13:31 +0300 Subject: [PATCH] fix: fixup previous commit --- drag_and_drop_v2/drag_and_drop_v2.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drag_and_drop_v2/drag_and_drop_v2.py b/drag_and_drop_v2/drag_and_drop_v2.py index c9f84cebc..3ab1af366 100644 --- a/drag_and_drop_v2/drag_and_drop_v2.py +++ b/drag_and_drop_v2/drag_and_drop_v2.py @@ -80,7 +80,7 @@ class DragAndDropBlock( SOLUTION_INCORRECT: None } - I18N_JS_NAMESPACE = 'DragAndDropI18N' + i18n_js_namespace = 'DragAndDropI18N' display_name = String( display_name=_("Title"), @@ -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 @@ -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))