From 6f6c471be42e732a6f629ec86886d1e0d4057a8c Mon Sep 17 00:00:00 2001 From: farhan Date: Fri, 27 Nov 2026 14:06:32 +0500 Subject: [PATCH] fix: stop translating Word Cloud's DOM id templates Since #351 the block's JS catalog is loaded, so gettext now translates the text_word_/title_word_ id templates. Many locales translate them (fr gives Texte_word_ but Titre_mot_, nl drops the prefix), so the ids in aria-describedby no longer match the /<text> ids and screen readers lose the word labels. Ids are not user-facing text. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --- src/xblock_word_cloud/static/js/src/word_cloud.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xblock_word_cloud/static/js/src/word_cloud.js b/src/xblock_word_cloud/static/js/src/word_cloud.js index 75b7eb6c..947a9bf4 100644 --- a/src/xblock_word_cloud/static/js/src/word_cloud.js +++ b/src/xblock_word_cloud/static/js/src/word_cloud.js @@ -251,7 +251,7 @@ function drawWordCloud(response, words, bounds, wordCloudEl) return wcCount; }) .attr('aria-describedby', () => interpolateHtml( - gettext('text_word_{uniqueId} title_word_{uniqueId}'), + 'text_word_{uniqueId} title_word_{uniqueId}', { // eslint-disable-next-line no-undef uniqueId: generateUniqueId(cloudSectionEl.attr('id'), $(this).data('id')), @@ -261,7 +261,7 @@ function drawWordCloud(response, words, bounds, wordCloudEl) groupEl .append('title') .attr('id', () => interpolateHtml( - gettext('title_word_{uniqueId}'), + 'title_word_{uniqueId}', { // eslint-disable-next-line no-undef uniqueId: generateUniqueId(cloudSectionEl.attr('id'), $(this).parent().data('id')), @@ -283,7 +283,7 @@ function drawWordCloud(response, words, bounds, wordCloudEl) groupEl .append('text') .attr('id', () => interpolateHtml( - gettext('text_word_{uniqueId}'), + 'text_word_{uniqueId}', { // eslint-disable-next-line no-undef uniqueId: generateUniqueId(cloudSectionEl.attr('id'), $(this).parent().data('id')),