Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add missing xblock parameter in get_javascript_i18n_catalog_url | FC-0012 #702

Merged
merged 1 commit into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ These are notable changes in XBlock.
Unreleased
----------

1.9.1 - 2023-12-22
------------------

* Fix: add ``get_javascript_i18n_catalog_url`` missing ``xblock`` parameter to match the Open edX LMS
XBlockI18nService.

1.9.0 - 2023-11-20
------------------

Expand Down
2 changes: 1 addition & 1 deletion xblock/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ def __init__(self, *args, **kwargs):
# without causing a circular import
xblock.fields.XBlockMixin = XBlockMixin

__version__ = '1.9.0'
__version__ = '1.9.1'
5 changes: 4 additions & 1 deletion xblock/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1357,10 +1357,13 @@ def strftime(self, dtime, format): # pylint: disable=redefined-builtin
timestring = dtime.strftime(format)
return timestring

def get_javascript_i18n_catalog_url(self):
def get_javascript_i18n_catalog_url(self, block): # pylint: disable=unused-argument
"""
Return the URL to the JavaScript i18n catalog file.

Args:
block (XBlock): The block that is requesting the URL.

This method returns None in NullI18nService. When implemented in
a runtime, it should return the URL to the JavaScript i18n catalog so
it can be loaded in frontends.
Expand Down
2 changes: 1 addition & 1 deletion xblock/test/test_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def assert_equals_unicode(str1, str2):
assert_equals_unicode("10:30:17 PM", i18n.strftime(when, "TIME"))

# Runtimes are expected to implement this method though.
assert i18n.get_javascript_i18n_catalog_url() is None, 'NullI18nService does not implement this method.'
assert i18n.get_javascript_i18n_catalog_url(object()) is None, 'NullI18nService does not implement this method.'

# secret_service is available.
assert self.runtime.service(self, "secret_service") == 17
Expand Down
Loading