i18n: strings that bypass the block catalog (JS namespace, remote_exec, lti_form)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 43/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- django, javascript, python
- Domain
- backend, internationalization
Research direction
Start with common/djangoapps/xblock_django/translation.py and the JS implementations for Video, Problem and Annotatable; the issue identifies xblock_problem/capa/safe_exec/remote_exec.py and xblock_lti's templates/lti_form.html as additional gaps. Check how blocks provide i18n_service and how namespaced JS catalogs are compiled. Done means the specified strings appear translated after pull_xblock_translations and compile_xblock_translations, including with built-in block code removed.
Written by the indexing model from the issue text.
Description
Follow-up to #329 (per-block translation catalogs, epic #241).
#329 gives each block its own catalog, but that catalog is only used when a string goes through the block's i18n service (XBlockI18nService in openedx-platform). Strings that skip the service are looked up in Django's global catalog. That catalog only has msgids from openedx-platform's own source, and the built-in copies of these strings are removed by the slash-n-burn PRs (openedx/openedx-platform#37819).
Gaps
- JS: no block defines
i18n_js_namespace.compile_xblock_js_messages(common/djangoapps/xblock_django/translation.py) only builds a JS catalog for blocks that define it, and the blocks' JS calls the globalgettext()/ngettext(). Video, Problem and Annotatable JS strings are translated today only because the platform's djangojs catalog has the same msgids fromxmodule/js/src/(about 55, 24 and 6 references).- Fix: set
i18n_js_namespaceon each block that has translatable JS, and call the namespacedgettext/ngettextin its JS. Each block'sxmodule/js/src/copy stays in the platform until its fix ships: Video (openedx/openedx-platform#38750), Problem (#38751), Annotatable (#38746).
- Fix: set
xblock_problem/capa/safe_exec/remote_exec.pyimportsdjango.utils.translation.gettextdirectly (3 codejail error messages). It's a module-level function with no block instance, so the translator has to be passed in.xblock_lti:templates/lti_form.htmlis rendered withouti18n_service(block.py,render_django_template("templates/lti_form.html", ...)). openedx/openedx-platform#38747 deletes the platform copy.
Not affected: other templates (Word Cloud, Poll, Annotatable, PDF, LTI lti.html) already pass i18n_service. Video video.html and the Discussion templates render without it, but the platform keeps its copies, so their msgids stay in the global catalog. Problem templates go through render_to_string and have had no platform copy since before slash-n-burn. That gap already exists on master and is worth a separate look.
Done when
- The Video, Problem and Annotatable JS strings, plus the two strings above, show up translated (e.g. in
ar) afterpull_xblock_translationsandcompile_xblock_translations, with the built-in block code removed.
Generated using Claude Code
- Dominant language
- JavaScript
- Stars
- 0
- Forks
- 19
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 9
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from openedx/xblocks-core
-
Difficulty 1/5 1-3 hours Newbie friendliness 84/100
openedx/xblocks-core#305 ·
Maintainers usually reply within 1 day
-
Update localization docs | xblocks-core, xblocks-extraPossibly taken @farhan claimed this 1 day ago. Open
openedx/xblocks-core#333 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 75/100
openedx/xblocks-core#326 ·
Maintainers usually reply within 1 day
-
Annotatable: newly created empty block in a Content Library V2 fails to render (XMLSyntaxError: Document is empty)Possibly taken @irfanuddinahmad claimed this 7 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 65/100
openedx/xblocks-core#323 · 1 comment ·
Maintainers usually reply within 1 day
-
ChoiceTextResponse: a submission that omits a required numtolerance_input key is graded correctOpen
Difficulty 3/5 1-2 days Newbie friendliness 65/100
openedx/xblocks-core#306 ·
Maintainers usually reply within 1 day
All issues in openedx/xblocks-core
Similar issues
-
db-d1-sqlite: upsert is aliased to updateOne, so payload.kv.set never inserts new keysPossibly taken @pcbeingused333 claimed this today. OpenBug db: d1-sqlite Payload OSS
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#19766 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
HarperFast/rocksdb-js#1131 ·
Maintainers usually reply within 1 day
-
Reveal: resolved but blocked Pending boundary hides its fallbackPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
anothaDev/luci-theme-vantage#137 ·
Maintainers usually reply within 1 day
-
Area/DeveloperPortal Aspect/UI Severity/Minor Type/Bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
wso2/api-platform#4369 ·
Maintainers usually reply within 1 day