diff --git a/common/djangoapps/xblock_django/tests/test_commands.py b/common/djangoapps/xblock_django/tests/test_commands.py index 322ee9384f..8a558b6beb 100644 --- a/common/djangoapps/xblock_django/tests/test_commands.py +++ b/common/djangoapps/xblock_django/tests/test_commands.py @@ -64,7 +64,7 @@ def test_compile_xblock_translations(tmp_translations_dir): 'msgfmt', '--check-format', '-o', str(po_file.with_suffix('.mo')), str(po_file), ], 'Compiles the .po files' - js_file_text = get_javascript_i18n_file_path('done', 'tr').text() + js_file_text = get_javascript_i18n_file_path('done', 'tr').read_text() assert 'Merhaba' in js_file_text, 'Ensures the JavaScript catalog is compiled' assert 'TestingDoneXBlockI18n' in js_file_text, 'Ensures the namespace is used' assert 'gettext' in js_file_text, 'Ensures the gettext function is defined' diff --git a/common/djangoapps/xblock_django/translation.py b/common/djangoapps/xblock_django/translation.py index 72726221aa..66f9642682 100644 --- a/common/djangoapps/xblock_django/translation.py +++ b/common/djangoapps/xblock_django/translation.py @@ -101,7 +101,7 @@ def compile_xblock_js_messages(): xblock_conf_locale_dir = xmodule_api.get_python_locale_root() / xblock_module i18n_js_namespace = xblock_class.get_i18n_js_namespace() - for locale_dir in xblock_conf_locale_dir.listdir(): + for locale_dir in xblock_conf_locale_dir.iterdir(): locale_code = str(locale_dir.basename()) locale_messages_dir = locale_dir / 'LC_MESSAGES' js_translations_domain = None