i18n: strings that bypass the block catalog (JS namespace, remote_exec, lti_form)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 43/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- django, javascript, python
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- JavaScript
- スター
- 0
- フォーク
- 19
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 9
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
openedx/xblocks-core のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 84/100
openedx/xblocks-core#305 ·
メンテナーはふだん 1 日以内に返信
-
Update localization docs | xblocks-core, xblocks-extra対応中かも @farhan が 1 日前に担当しました。 オープン
openedx/xblocks-core#333 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 75/100
openedx/xblocks-core#326 ·
メンテナーはふだん 1 日以内に返信
-
Annotatable: newly created empty block in a Content Library V2 fails to render (XMLSyntaxError: Document is empty)対応中かも @irfanuddinahmad が 8 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
openedx/xblocks-core#323 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
ChoiceTextResponse: a submission that omits a required numtolerance_input key is graded correctオープン
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
openedx/xblocks-core#306 ·
メンテナーはふだん 1 日以内に返信
openedx/xblocks-core の issue をすべて見る
似ている issue
-
type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
ai-amazon-bedrock: a tool result that isn't a JSON object fails the next request対応中かも @effect-bot が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
[bug] Toolchain versions from `.prototools` are not inherited when moon runs from a subdirectoryオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
check:passed logos:edit
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信