Skip to content

Commit 73032b9

Browse files
author
Feanil Patel
authored
Merge pull request #702 from Zeit-Labs/missing-param
fix: add missing ``xblock`` parameter in `get_javascript_i18n_catalog_url` | FC-0012
2 parents 5a95582 + d700f13 commit 73032b9

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ These are notable changes in XBlock.
77
Unreleased
88
----------
99

10+
1.9.1 - 2023-12-22
11+
------------------
12+
13+
* Fix: add ``get_javascript_i18n_catalog_url`` missing ``xblock`` parameter to match the Open edX LMS
14+
XBlockI18nService.
15+
1016
1.9.0 - 2023-11-20
1117
------------------
1218

xblock/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ def __init__(self, *args, **kwargs):
2727
# without causing a circular import
2828
xblock.fields.XBlockMixin = XBlockMixin
2929

30-
__version__ = '1.9.0'
30+
__version__ = '1.9.1'

xblock/runtime.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,10 +1357,13 @@ def strftime(self, dtime, format): # pylint: disable=redefined-builtin
13571357
timestring = dtime.strftime(format)
13581358
return timestring
13591359

1360-
def get_javascript_i18n_catalog_url(self):
1360+
def get_javascript_i18n_catalog_url(self, block): # pylint: disable=unused-argument
13611361
"""
13621362
Return the URL to the JavaScript i18n catalog file.
13631363
1364+
Args:
1365+
block (XBlock): The block that is requesting the URL.
1366+
13641367
This method returns None in NullI18nService. When implemented in
13651368
a runtime, it should return the URL to the JavaScript i18n catalog so
13661369
it can be loaded in frontends.

xblock/test/test_runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ def assert_equals_unicode(str1, str2):
524524
assert_equals_unicode("10:30:17 PM", i18n.strftime(when, "TIME"))
525525

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

529529
# secret_service is available.
530530
assert self.runtime.service(self, "secret_service") == 17

0 commit comments

Comments
 (0)