From 90d03684b12c90b26bf6686d228ae38897e69ab6 Mon Sep 17 00:00:00 2001 From: farhan Date: Mon, 16 Nov 2026 15:14:25 +0500 Subject: [PATCH 1/3] build: extract translations per xblock for openedx-translations openedx-platform looks up xblock translations by module name (translations/*//conf/locale), so a single combined catalog can't be matched to the blocks. Write one django.po per block under /conf/locale/ instead, mirroring openedx/xblocks-extra#35. The compile/dummy/validate/pull/push targets and the translations tox env relied on the old src/ text.po layout, so they are removed. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 2 +- Makefile | 79 +++-------------- .../conf/locale/config.yaml | 84 ------------------- src/xblock_discussion/conf/locale/config.yaml | 84 ------------------- src/xblock_html/conf/locale/config.yaml | 84 ------------------- src/xblock_lti/conf/locale/config.yaml | 84 ------------------- src/xblock_pdf/.tx/config | 8 ++ src/xblock_pdf/conf/locale/__init__.py | 0 src/xblock_pdf/conf/locale/config.yaml | 9 ++ .../conf/locale/config.yaml | 84 ------------------- src/xblock_problem/conf/locale/config.yaml | 84 ------------------- src/xblock_video/conf/locale/config.yaml | 84 ------------------- src/xblock_word_cloud/conf/locale/config.yaml | 84 ------------------- tox.ini | 8 -- 14 files changed, 29 insertions(+), 749 deletions(-) create mode 100644 src/xblock_pdf/.tx/config create mode 100644 src/xblock_pdf/conf/locale/__init__.py create mode 100644 src/xblock_pdf/conf/locale/config.yaml diff --git a/.gitignore b/.gitignore index 7e5a0cec..f8a2d80e 100644 --- a/.gitignore +++ b/.gitignore @@ -92,7 +92,7 @@ requirements/private.txt # Translations *.mo *.pot -*.po +**/conf/locale/**/LC_MESSAGES/* # Node.js / npm / yarn / pnpm node_modules/ diff --git a/Makefile b/Makefile index ffe5e2e1..3950122f 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,13 @@ .DEFAULT_GOAL := help .PHONY: upgrade help requirements quality format test docs -.PHONY: extract_translations compile_translations -.PHONY: detect_changed_source_translations dummy_translations build_dummy_translations -.PHONY: validate_translations pull_translations push_translations install_transifex_clients +.PHONY: extract_translations +REPO_ROOT := $(shell pwd) SRC_DIR := src EXTRACT_DIR := conf/locale/en/LC_MESSAGES -# Combined-locale output for the openedx-translations pipeline (OEP-58), -# which expects a single `django.po` source file per repository. -COMBINED_LOCALE_DIR := $(SRC_DIR)/xblocks_core_locale/conf/locale/en/LC_MESSAGES -JS_TARGET := $(SRC_DIR)/xblocks_core_locale/public/js/translations +# XBlock directories: each src/xblock_/ that has its own conf/ subdir +XBLOCKS=$(shell find $(REPO_ROOT)/$(SRC_DIR) -mindepth 2 -maxdepth 2 -type d -name 'conf' -exec dirname {} \;) help: @perl -nle'print $& if m{^[\.a-zA-Z_-]+:.*?## .*$$}' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m %-25s\033[0m %s\n", $$1, $$2}' @@ -36,76 +33,22 @@ requirements: ## install development environment requirements using uv uv sync --group dev uv tool install tox --with tox-uv -# XBlock directories: each src/xblock_/ that has its own conf/ subdir -XBLOCKS=$(shell find $(shell pwd)/$(SRC_DIR) -mindepth 2 -maxdepth 2 -type d -name 'conf' -exec dirname {} \;) - ## Localization targets -extract_translations: ## extract strings to be translated, outputting .po files for each XBlock +extract_translations: ## extract strings to be translated, outputting .po files under /conf/locale/ @for xblock in $(XBLOCKS); do \ - echo "Extracting translations for $$xblock..."; \ + module_name=$$(basename $$xblock); \ + echo "Extracting translations for $$module_name..."; \ cd $$xblock && i18n_tool extract --no-segment; \ if [ -f $$xblock/$(EXTRACT_DIR)/djangojs.po ]; then \ - cd $$xblock/$(EXTRACT_DIR) && msgcat django.po djangojs.po -o django.po && rm -f djangojs.po; \ + msgcat $$xblock/$(EXTRACT_DIR)/django.po $$xblock/$(EXTRACT_DIR)/djangojs.po \ + -o $$xblock/$(EXTRACT_DIR)/django.po && rm -f $$xblock/$(EXTRACT_DIR)/djangojs.po; \ fi; \ + mkdir -p $(REPO_ROOT)/$$module_name/$(EXTRACT_DIR); \ if [ -f $$xblock/$(EXTRACT_DIR)/django.po ]; then \ - mv $$xblock/$(EXTRACT_DIR)/django.po $$xblock/$(EXTRACT_DIR)/text.po; \ + mv $$xblock/$(EXTRACT_DIR)/django.po $(REPO_ROOT)/$$module_name/$(EXTRACT_DIR)/django.po; \ fi; \ done - @# Merge all per-xblock text.po files into a single combined file for the - @# openedx-translations pipeline (OEP-58), which expects one conf/locale/en per repo. - @mkdir -p $(COMBINED_LOCALE_DIR) - @PO_FILES=""; \ - for xblock in $(XBLOCKS); do \ - if [ -f $$xblock/$(EXTRACT_DIR)/text.po ]; then \ - PO_FILES="$$PO_FILES $$xblock/$(EXTRACT_DIR)/text.po"; \ - fi; \ - done; \ - if [ -n "$$PO_FILES" ]; then \ - msgcat --use-first $$PO_FILES -o $(COMBINED_LOCALE_DIR)/django.po; \ - echo "Combined translation source file written to $(COMBINED_LOCALE_DIR)/django.po"; \ - fi - -compile_translations: ## compile translation files, outputting .mo files for each supported language for each XBlock - @for xblock in $(XBLOCKS); do \ - echo "Compiling translations for $$xblock..."; \ - cd $$xblock && django-admin compilemessages --locale en; \ - done - -detect_changed_source_translations: - @for xblock in $(XBLOCKS); do \ - echo "Detecting changed translations for $$xblock..."; \ - cd $$xblock && i18n_tool changed; \ - done - -dummy_translations: ## generate dummy translation (.po) files for each XBlock - @for xblock in $(XBLOCKS); do \ - echo "Generating dummy translations for $$xblock..."; \ - cd $$xblock && i18n_tool dummy; \ - done - -build_dummy_translations: extract_translations dummy_translations compile_translations ## generate and compile dummy translation files - -validate_translations: build_dummy_translations detect_changed_source_translations ## validate translations - -pull_translations: ## pull translations from Transifex for each XBlock - @for xblock in $(XBLOCKS); do \ - echo "Pulling translations for $$xblock..."; \ - cd $$xblock && i18n_tool transifex pull; \ - done - -push_translations: extract_translations ## push translations to Transifex for each XBlock - @for xblock in $(XBLOCKS); do \ - echo "Pushing translations for $$xblock..."; \ - cd $$xblock && i18n_tool transifex push; \ - done - -install_transifex_client: ## Install the Transifex client - # Instaling client will skip CHANGELOG and LICENSE files from git changes - # so remind the user to commit the change first before installing client. - git diff -s --exit-code HEAD || { echo "Please commit changes first."; exit 1; } - curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash - git checkout -- LICENSE README.md ## overwritten by Transifex installer selfcheck: ## check that the Makefile is well-formed @echo "The Makefile is well-formed." diff --git a/src/xblock_annotatable/conf/locale/config.yaml b/src/xblock_annotatable/conf/locale/config.yaml index 4bfb0cac..129dc597 100644 --- a/src/xblock_annotatable/conf/locale/config.yaml +++ b/src/xblock_annotatable/conf/locale/config.yaml @@ -2,90 +2,6 @@ locales: - en # English - Source Language - # - am # Amharic - - ar # Arabic - # - az # Azerbaijani - # - bg_BG # Bulgarian (Bulgaria) - # - bn_BD # Bengali (Bangladesh) - # - bn_IN # Bengali (India) - # - bs # Bosnian - # - ca # Catalan - # - ca@valencia # Catalan (Valencia) - # - cs # Czech - # - cy # Welsh - # - da # Danish - # - de_DE # German (Germany) - # - el # Greek - # - en_GB # English (United Kingdom) - # # Don't pull these until we figure out why pages randomly display in these locales, - # # when the user's browser is in English and the user is not logged in. - # #- en@lolcat # LOLCAT English - # #- en@pirate # Pirate English - - es_419 # Spanish (Latin America) - # - es_AR # Spanish (Argentina) - # - es_EC # Spanish (Ecuador) - # - es_ES # Spanish (Spain) - # - es_MX # Spanish (Mexico) - # - es_PE # Spanish (Peru) - # - et_EE # Estonian (Estonia) - # - eu_ES # Basque (Spain) - # - fa # Persian - # - fa_IR # Persian (Iran) - # - fi_FI # Finnish (Finland) - # - fil # Filipino - - fr # French - # - gl # Galician - # - gu # Gujarati - - he # Hebrew - - hi # Hindi - # - hr # Croatian - # - hu # Hungarian - # - hy_AM # Armenian (Armenia) - # - id # Indonesian - # - it_IT # Italian (Italy) - # - ja_JP # Japanese (Japan) - # - kk_KZ # Kazakh (Kazakhstan) - # - km_KH # Khmer (Cambodia) - # - kn # Kannada - - ko_KR # Korean (Korea) - # - lt_LT # Lithuanian (Lithuania) - # - ml # Malayalam - # - mn # Mongolian - # - mr # Marathi - # - ms # Malay - # - nb # Norwegian Bokmål - # - ne # Nepali - # - nl_NL # Dutch (Netherlands) - # - or # Oriya - # - pl # Polish - - pt_BR # Portuguese (Brazil) - # - pt_PT # Portuguese (Portugal) - # - ro # Romanian - - ru # Russian - # - si # Sinhala - # - sk # Slovak - # - sl # Slovenian - # - sq # Albanian - # - sr # Serbian - # - sv # Swedish - # - sw # Swahili - # - ta # Tamil - # - te # Telugu - # - th # Thai - # - tr_TR # Turkish (Turkey) - # - uk # Ukranian - # - ur # Urdu - # - uz # Uzbek - # - vi # Vietnamese - - zh_CN # Chinese (China) - # - zh_HK # Chinese (Hong Kong) - # - zh_TW # Chinese (Taiwan) - - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo - - rtl # Fake testing language for Arabic # Directories we don't search for strings. ignore_dirs: diff --git a/src/xblock_discussion/conf/locale/config.yaml b/src/xblock_discussion/conf/locale/config.yaml index 4bfb0cac..129dc597 100644 --- a/src/xblock_discussion/conf/locale/config.yaml +++ b/src/xblock_discussion/conf/locale/config.yaml @@ -2,90 +2,6 @@ locales: - en # English - Source Language - # - am # Amharic - - ar # Arabic - # - az # Azerbaijani - # - bg_BG # Bulgarian (Bulgaria) - # - bn_BD # Bengali (Bangladesh) - # - bn_IN # Bengali (India) - # - bs # Bosnian - # - ca # Catalan - # - ca@valencia # Catalan (Valencia) - # - cs # Czech - # - cy # Welsh - # - da # Danish - # - de_DE # German (Germany) - # - el # Greek - # - en_GB # English (United Kingdom) - # # Don't pull these until we figure out why pages randomly display in these locales, - # # when the user's browser is in English and the user is not logged in. - # #- en@lolcat # LOLCAT English - # #- en@pirate # Pirate English - - es_419 # Spanish (Latin America) - # - es_AR # Spanish (Argentina) - # - es_EC # Spanish (Ecuador) - # - es_ES # Spanish (Spain) - # - es_MX # Spanish (Mexico) - # - es_PE # Spanish (Peru) - # - et_EE # Estonian (Estonia) - # - eu_ES # Basque (Spain) - # - fa # Persian - # - fa_IR # Persian (Iran) - # - fi_FI # Finnish (Finland) - # - fil # Filipino - - fr # French - # - gl # Galician - # - gu # Gujarati - - he # Hebrew - - hi # Hindi - # - hr # Croatian - # - hu # Hungarian - # - hy_AM # Armenian (Armenia) - # - id # Indonesian - # - it_IT # Italian (Italy) - # - ja_JP # Japanese (Japan) - # - kk_KZ # Kazakh (Kazakhstan) - # - km_KH # Khmer (Cambodia) - # - kn # Kannada - - ko_KR # Korean (Korea) - # - lt_LT # Lithuanian (Lithuania) - # - ml # Malayalam - # - mn # Mongolian - # - mr # Marathi - # - ms # Malay - # - nb # Norwegian Bokmål - # - ne # Nepali - # - nl_NL # Dutch (Netherlands) - # - or # Oriya - # - pl # Polish - - pt_BR # Portuguese (Brazil) - # - pt_PT # Portuguese (Portugal) - # - ro # Romanian - - ru # Russian - # - si # Sinhala - # - sk # Slovak - # - sl # Slovenian - # - sq # Albanian - # - sr # Serbian - # - sv # Swedish - # - sw # Swahili - # - ta # Tamil - # - te # Telugu - # - th # Thai - # - tr_TR # Turkish (Turkey) - # - uk # Ukranian - # - ur # Urdu - # - uz # Uzbek - # - vi # Vietnamese - - zh_CN # Chinese (China) - # - zh_HK # Chinese (Hong Kong) - # - zh_TW # Chinese (Taiwan) - - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo - - rtl # Fake testing language for Arabic # Directories we don't search for strings. ignore_dirs: diff --git a/src/xblock_html/conf/locale/config.yaml b/src/xblock_html/conf/locale/config.yaml index 4bfb0cac..129dc597 100644 --- a/src/xblock_html/conf/locale/config.yaml +++ b/src/xblock_html/conf/locale/config.yaml @@ -2,90 +2,6 @@ locales: - en # English - Source Language - # - am # Amharic - - ar # Arabic - # - az # Azerbaijani - # - bg_BG # Bulgarian (Bulgaria) - # - bn_BD # Bengali (Bangladesh) - # - bn_IN # Bengali (India) - # - bs # Bosnian - # - ca # Catalan - # - ca@valencia # Catalan (Valencia) - # - cs # Czech - # - cy # Welsh - # - da # Danish - # - de_DE # German (Germany) - # - el # Greek - # - en_GB # English (United Kingdom) - # # Don't pull these until we figure out why pages randomly display in these locales, - # # when the user's browser is in English and the user is not logged in. - # #- en@lolcat # LOLCAT English - # #- en@pirate # Pirate English - - es_419 # Spanish (Latin America) - # - es_AR # Spanish (Argentina) - # - es_EC # Spanish (Ecuador) - # - es_ES # Spanish (Spain) - # - es_MX # Spanish (Mexico) - # - es_PE # Spanish (Peru) - # - et_EE # Estonian (Estonia) - # - eu_ES # Basque (Spain) - # - fa # Persian - # - fa_IR # Persian (Iran) - # - fi_FI # Finnish (Finland) - # - fil # Filipino - - fr # French - # - gl # Galician - # - gu # Gujarati - - he # Hebrew - - hi # Hindi - # - hr # Croatian - # - hu # Hungarian - # - hy_AM # Armenian (Armenia) - # - id # Indonesian - # - it_IT # Italian (Italy) - # - ja_JP # Japanese (Japan) - # - kk_KZ # Kazakh (Kazakhstan) - # - km_KH # Khmer (Cambodia) - # - kn # Kannada - - ko_KR # Korean (Korea) - # - lt_LT # Lithuanian (Lithuania) - # - ml # Malayalam - # - mn # Mongolian - # - mr # Marathi - # - ms # Malay - # - nb # Norwegian Bokmål - # - ne # Nepali - # - nl_NL # Dutch (Netherlands) - # - or # Oriya - # - pl # Polish - - pt_BR # Portuguese (Brazil) - # - pt_PT # Portuguese (Portugal) - # - ro # Romanian - - ru # Russian - # - si # Sinhala - # - sk # Slovak - # - sl # Slovenian - # - sq # Albanian - # - sr # Serbian - # - sv # Swedish - # - sw # Swahili - # - ta # Tamil - # - te # Telugu - # - th # Thai - # - tr_TR # Turkish (Turkey) - # - uk # Ukranian - # - ur # Urdu - # - uz # Uzbek - # - vi # Vietnamese - - zh_CN # Chinese (China) - # - zh_HK # Chinese (Hong Kong) - # - zh_TW # Chinese (Taiwan) - - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo - - rtl # Fake testing language for Arabic # Directories we don't search for strings. ignore_dirs: diff --git a/src/xblock_lti/conf/locale/config.yaml b/src/xblock_lti/conf/locale/config.yaml index 4bfb0cac..129dc597 100644 --- a/src/xblock_lti/conf/locale/config.yaml +++ b/src/xblock_lti/conf/locale/config.yaml @@ -2,90 +2,6 @@ locales: - en # English - Source Language - # - am # Amharic - - ar # Arabic - # - az # Azerbaijani - # - bg_BG # Bulgarian (Bulgaria) - # - bn_BD # Bengali (Bangladesh) - # - bn_IN # Bengali (India) - # - bs # Bosnian - # - ca # Catalan - # - ca@valencia # Catalan (Valencia) - # - cs # Czech - # - cy # Welsh - # - da # Danish - # - de_DE # German (Germany) - # - el # Greek - # - en_GB # English (United Kingdom) - # # Don't pull these until we figure out why pages randomly display in these locales, - # # when the user's browser is in English and the user is not logged in. - # #- en@lolcat # LOLCAT English - # #- en@pirate # Pirate English - - es_419 # Spanish (Latin America) - # - es_AR # Spanish (Argentina) - # - es_EC # Spanish (Ecuador) - # - es_ES # Spanish (Spain) - # - es_MX # Spanish (Mexico) - # - es_PE # Spanish (Peru) - # - et_EE # Estonian (Estonia) - # - eu_ES # Basque (Spain) - # - fa # Persian - # - fa_IR # Persian (Iran) - # - fi_FI # Finnish (Finland) - # - fil # Filipino - - fr # French - # - gl # Galician - # - gu # Gujarati - - he # Hebrew - - hi # Hindi - # - hr # Croatian - # - hu # Hungarian - # - hy_AM # Armenian (Armenia) - # - id # Indonesian - # - it_IT # Italian (Italy) - # - ja_JP # Japanese (Japan) - # - kk_KZ # Kazakh (Kazakhstan) - # - km_KH # Khmer (Cambodia) - # - kn # Kannada - - ko_KR # Korean (Korea) - # - lt_LT # Lithuanian (Lithuania) - # - ml # Malayalam - # - mn # Mongolian - # - mr # Marathi - # - ms # Malay - # - nb # Norwegian Bokmål - # - ne # Nepali - # - nl_NL # Dutch (Netherlands) - # - or # Oriya - # - pl # Polish - - pt_BR # Portuguese (Brazil) - # - pt_PT # Portuguese (Portugal) - # - ro # Romanian - - ru # Russian - # - si # Sinhala - # - sk # Slovak - # - sl # Slovenian - # - sq # Albanian - # - sr # Serbian - # - sv # Swedish - # - sw # Swahili - # - ta # Tamil - # - te # Telugu - # - th # Thai - # - tr_TR # Turkish (Turkey) - # - uk # Ukranian - # - ur # Urdu - # - uz # Uzbek - # - vi # Vietnamese - - zh_CN # Chinese (China) - # - zh_HK # Chinese (Hong Kong) - # - zh_TW # Chinese (Taiwan) - - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo - - rtl # Fake testing language for Arabic # Directories we don't search for strings. ignore_dirs: diff --git a/src/xblock_pdf/.tx/config b/src/xblock_pdf/.tx/config new file mode 100644 index 00000000..caa617d1 --- /dev/null +++ b/src/xblock_pdf/.tx/config @@ -0,0 +1,8 @@ +[main] +host = https://www.transifex.com + +[o:open-edx:p:openedx-translations:r:xblock-pdf] +file_filter = conf/locale//LC_MESSAGES/text.po +source_file = conf/locale/en/LC_MESSAGES/text.po +source_lang = en +type = PO diff --git a/src/xblock_pdf/conf/locale/__init__.py b/src/xblock_pdf/conf/locale/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/src/xblock_pdf/conf/locale/config.yaml b/src/xblock_pdf/conf/locale/config.yaml new file mode 100644 index 00000000..129dc597 --- /dev/null +++ b/src/xblock_pdf/conf/locale/config.yaml @@ -0,0 +1,9 @@ +# Configuration for i18n workflow. + +locales: + - en # English - Source Language + +# Directories we don't search for strings. +ignore_dirs: + - '*/css' + - 'public/js/translations' diff --git a/src/xblock_poll_question/conf/locale/config.yaml b/src/xblock_poll_question/conf/locale/config.yaml index 4bfb0cac..129dc597 100644 --- a/src/xblock_poll_question/conf/locale/config.yaml +++ b/src/xblock_poll_question/conf/locale/config.yaml @@ -2,90 +2,6 @@ locales: - en # English - Source Language - # - am # Amharic - - ar # Arabic - # - az # Azerbaijani - # - bg_BG # Bulgarian (Bulgaria) - # - bn_BD # Bengali (Bangladesh) - # - bn_IN # Bengali (India) - # - bs # Bosnian - # - ca # Catalan - # - ca@valencia # Catalan (Valencia) - # - cs # Czech - # - cy # Welsh - # - da # Danish - # - de_DE # German (Germany) - # - el # Greek - # - en_GB # English (United Kingdom) - # # Don't pull these until we figure out why pages randomly display in these locales, - # # when the user's browser is in English and the user is not logged in. - # #- en@lolcat # LOLCAT English - # #- en@pirate # Pirate English - - es_419 # Spanish (Latin America) - # - es_AR # Spanish (Argentina) - # - es_EC # Spanish (Ecuador) - # - es_ES # Spanish (Spain) - # - es_MX # Spanish (Mexico) - # - es_PE # Spanish (Peru) - # - et_EE # Estonian (Estonia) - # - eu_ES # Basque (Spain) - # - fa # Persian - # - fa_IR # Persian (Iran) - # - fi_FI # Finnish (Finland) - # - fil # Filipino - - fr # French - # - gl # Galician - # - gu # Gujarati - - he # Hebrew - - hi # Hindi - # - hr # Croatian - # - hu # Hungarian - # - hy_AM # Armenian (Armenia) - # - id # Indonesian - # - it_IT # Italian (Italy) - # - ja_JP # Japanese (Japan) - # - kk_KZ # Kazakh (Kazakhstan) - # - km_KH # Khmer (Cambodia) - # - kn # Kannada - - ko_KR # Korean (Korea) - # - lt_LT # Lithuanian (Lithuania) - # - ml # Malayalam - # - mn # Mongolian - # - mr # Marathi - # - ms # Malay - # - nb # Norwegian Bokmål - # - ne # Nepali - # - nl_NL # Dutch (Netherlands) - # - or # Oriya - # - pl # Polish - - pt_BR # Portuguese (Brazil) - # - pt_PT # Portuguese (Portugal) - # - ro # Romanian - - ru # Russian - # - si # Sinhala - # - sk # Slovak - # - sl # Slovenian - # - sq # Albanian - # - sr # Serbian - # - sv # Swedish - # - sw # Swahili - # - ta # Tamil - # - te # Telugu - # - th # Thai - # - tr_TR # Turkish (Turkey) - # - uk # Ukranian - # - ur # Urdu - # - uz # Uzbek - # - vi # Vietnamese - - zh_CN # Chinese (China) - # - zh_HK # Chinese (Hong Kong) - # - zh_TW # Chinese (Taiwan) - - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo - - rtl # Fake testing language for Arabic # Directories we don't search for strings. ignore_dirs: diff --git a/src/xblock_problem/conf/locale/config.yaml b/src/xblock_problem/conf/locale/config.yaml index 4bfb0cac..129dc597 100644 --- a/src/xblock_problem/conf/locale/config.yaml +++ b/src/xblock_problem/conf/locale/config.yaml @@ -2,90 +2,6 @@ locales: - en # English - Source Language - # - am # Amharic - - ar # Arabic - # - az # Azerbaijani - # - bg_BG # Bulgarian (Bulgaria) - # - bn_BD # Bengali (Bangladesh) - # - bn_IN # Bengali (India) - # - bs # Bosnian - # - ca # Catalan - # - ca@valencia # Catalan (Valencia) - # - cs # Czech - # - cy # Welsh - # - da # Danish - # - de_DE # German (Germany) - # - el # Greek - # - en_GB # English (United Kingdom) - # # Don't pull these until we figure out why pages randomly display in these locales, - # # when the user's browser is in English and the user is not logged in. - # #- en@lolcat # LOLCAT English - # #- en@pirate # Pirate English - - es_419 # Spanish (Latin America) - # - es_AR # Spanish (Argentina) - # - es_EC # Spanish (Ecuador) - # - es_ES # Spanish (Spain) - # - es_MX # Spanish (Mexico) - # - es_PE # Spanish (Peru) - # - et_EE # Estonian (Estonia) - # - eu_ES # Basque (Spain) - # - fa # Persian - # - fa_IR # Persian (Iran) - # - fi_FI # Finnish (Finland) - # - fil # Filipino - - fr # French - # - gl # Galician - # - gu # Gujarati - - he # Hebrew - - hi # Hindi - # - hr # Croatian - # - hu # Hungarian - # - hy_AM # Armenian (Armenia) - # - id # Indonesian - # - it_IT # Italian (Italy) - # - ja_JP # Japanese (Japan) - # - kk_KZ # Kazakh (Kazakhstan) - # - km_KH # Khmer (Cambodia) - # - kn # Kannada - - ko_KR # Korean (Korea) - # - lt_LT # Lithuanian (Lithuania) - # - ml # Malayalam - # - mn # Mongolian - # - mr # Marathi - # - ms # Malay - # - nb # Norwegian Bokmål - # - ne # Nepali - # - nl_NL # Dutch (Netherlands) - # - or # Oriya - # - pl # Polish - - pt_BR # Portuguese (Brazil) - # - pt_PT # Portuguese (Portugal) - # - ro # Romanian - - ru # Russian - # - si # Sinhala - # - sk # Slovak - # - sl # Slovenian - # - sq # Albanian - # - sr # Serbian - # - sv # Swedish - # - sw # Swahili - # - ta # Tamil - # - te # Telugu - # - th # Thai - # - tr_TR # Turkish (Turkey) - # - uk # Ukranian - # - ur # Urdu - # - uz # Uzbek - # - vi # Vietnamese - - zh_CN # Chinese (China) - # - zh_HK # Chinese (Hong Kong) - # - zh_TW # Chinese (Taiwan) - - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo - - rtl # Fake testing language for Arabic # Directories we don't search for strings. ignore_dirs: diff --git a/src/xblock_video/conf/locale/config.yaml b/src/xblock_video/conf/locale/config.yaml index 4bfb0cac..129dc597 100644 --- a/src/xblock_video/conf/locale/config.yaml +++ b/src/xblock_video/conf/locale/config.yaml @@ -2,90 +2,6 @@ locales: - en # English - Source Language - # - am # Amharic - - ar # Arabic - # - az # Azerbaijani - # - bg_BG # Bulgarian (Bulgaria) - # - bn_BD # Bengali (Bangladesh) - # - bn_IN # Bengali (India) - # - bs # Bosnian - # - ca # Catalan - # - ca@valencia # Catalan (Valencia) - # - cs # Czech - # - cy # Welsh - # - da # Danish - # - de_DE # German (Germany) - # - el # Greek - # - en_GB # English (United Kingdom) - # # Don't pull these until we figure out why pages randomly display in these locales, - # # when the user's browser is in English and the user is not logged in. - # #- en@lolcat # LOLCAT English - # #- en@pirate # Pirate English - - es_419 # Spanish (Latin America) - # - es_AR # Spanish (Argentina) - # - es_EC # Spanish (Ecuador) - # - es_ES # Spanish (Spain) - # - es_MX # Spanish (Mexico) - # - es_PE # Spanish (Peru) - # - et_EE # Estonian (Estonia) - # - eu_ES # Basque (Spain) - # - fa # Persian - # - fa_IR # Persian (Iran) - # - fi_FI # Finnish (Finland) - # - fil # Filipino - - fr # French - # - gl # Galician - # - gu # Gujarati - - he # Hebrew - - hi # Hindi - # - hr # Croatian - # - hu # Hungarian - # - hy_AM # Armenian (Armenia) - # - id # Indonesian - # - it_IT # Italian (Italy) - # - ja_JP # Japanese (Japan) - # - kk_KZ # Kazakh (Kazakhstan) - # - km_KH # Khmer (Cambodia) - # - kn # Kannada - - ko_KR # Korean (Korea) - # - lt_LT # Lithuanian (Lithuania) - # - ml # Malayalam - # - mn # Mongolian - # - mr # Marathi - # - ms # Malay - # - nb # Norwegian Bokmål - # - ne # Nepali - # - nl_NL # Dutch (Netherlands) - # - or # Oriya - # - pl # Polish - - pt_BR # Portuguese (Brazil) - # - pt_PT # Portuguese (Portugal) - # - ro # Romanian - - ru # Russian - # - si # Sinhala - # - sk # Slovak - # - sl # Slovenian - # - sq # Albanian - # - sr # Serbian - # - sv # Swedish - # - sw # Swahili - # - ta # Tamil - # - te # Telugu - # - th # Thai - # - tr_TR # Turkish (Turkey) - # - uk # Ukranian - # - ur # Urdu - # - uz # Uzbek - # - vi # Vietnamese - - zh_CN # Chinese (China) - # - zh_HK # Chinese (Hong Kong) - # - zh_TW # Chinese (Taiwan) - - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo - - rtl # Fake testing language for Arabic # Directories we don't search for strings. ignore_dirs: diff --git a/src/xblock_word_cloud/conf/locale/config.yaml b/src/xblock_word_cloud/conf/locale/config.yaml index 4bfb0cac..129dc597 100644 --- a/src/xblock_word_cloud/conf/locale/config.yaml +++ b/src/xblock_word_cloud/conf/locale/config.yaml @@ -2,90 +2,6 @@ locales: - en # English - Source Language - # - am # Amharic - - ar # Arabic - # - az # Azerbaijani - # - bg_BG # Bulgarian (Bulgaria) - # - bn_BD # Bengali (Bangladesh) - # - bn_IN # Bengali (India) - # - bs # Bosnian - # - ca # Catalan - # - ca@valencia # Catalan (Valencia) - # - cs # Czech - # - cy # Welsh - # - da # Danish - # - de_DE # German (Germany) - # - el # Greek - # - en_GB # English (United Kingdom) - # # Don't pull these until we figure out why pages randomly display in these locales, - # # when the user's browser is in English and the user is not logged in. - # #- en@lolcat # LOLCAT English - # #- en@pirate # Pirate English - - es_419 # Spanish (Latin America) - # - es_AR # Spanish (Argentina) - # - es_EC # Spanish (Ecuador) - # - es_ES # Spanish (Spain) - # - es_MX # Spanish (Mexico) - # - es_PE # Spanish (Peru) - # - et_EE # Estonian (Estonia) - # - eu_ES # Basque (Spain) - # - fa # Persian - # - fa_IR # Persian (Iran) - # - fi_FI # Finnish (Finland) - # - fil # Filipino - - fr # French - # - gl # Galician - # - gu # Gujarati - - he # Hebrew - - hi # Hindi - # - hr # Croatian - # - hu # Hungarian - # - hy_AM # Armenian (Armenia) - # - id # Indonesian - # - it_IT # Italian (Italy) - # - ja_JP # Japanese (Japan) - # - kk_KZ # Kazakh (Kazakhstan) - # - km_KH # Khmer (Cambodia) - # - kn # Kannada - - ko_KR # Korean (Korea) - # - lt_LT # Lithuanian (Lithuania) - # - ml # Malayalam - # - mn # Mongolian - # - mr # Marathi - # - ms # Malay - # - nb # Norwegian Bokmål - # - ne # Nepali - # - nl_NL # Dutch (Netherlands) - # - or # Oriya - # - pl # Polish - - pt_BR # Portuguese (Brazil) - # - pt_PT # Portuguese (Portugal) - # - ro # Romanian - - ru # Russian - # - si # Sinhala - # - sk # Slovak - # - sl # Slovenian - # - sq # Albanian - # - sr # Serbian - # - sv # Swedish - # - sw # Swahili - # - ta # Tamil - # - te # Telugu - # - th # Thai - # - tr_TR # Turkish (Turkey) - # - uk # Ukranian - # - ur # Urdu - # - uz # Uzbek - # - vi # Vietnamese - - zh_CN # Chinese (China) - # - zh_HK # Chinese (Hong Kong) - # - zh_TW # Chinese (Taiwan) - - -# The locales used for fake-accented English, for testing. -dummy_locales: - - eo - - rtl # Fake testing language for Arabic # Directories we don't search for strings. ignore_dirs: diff --git a/tox.ini b/tox.ini index 4b79883b..70c58f80 100644 --- a/tox.ini +++ b/tox.ini @@ -31,14 +31,6 @@ commands = make -e -C docs clean make -e -C docs html -[testenv:translations] -runner = uv-venv-lock-runner -allowlist_externals = - make -dependency_groups = dev -commands = - make validate_translations - [testenv:quality] runner = uv-venv-lock-runner allowlist_externals = From 494446a26a79b8df7f0475ed0b8a74e824b8d2bd Mon Sep 17 00:00:00 2001 From: farhan Date: Mon, 16 Nov 2026 15:40:11 +0500 Subject: [PATCH 2/3] build: drop the unused Transifex client config for xblock_pdf Extraction only needs conf/locale/, and OEP-58 syncs through the Transifex GitHub App, so the client .tx/config (which pointed at the no-longer-produced text.po) is not needed. Co-Authored-By: Claude Opus 5.5 --- src/xblock_pdf/.tx/config | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 src/xblock_pdf/.tx/config diff --git a/src/xblock_pdf/.tx/config b/src/xblock_pdf/.tx/config deleted file mode 100644 index caa617d1..00000000 --- a/src/xblock_pdf/.tx/config +++ /dev/null @@ -1,8 +0,0 @@ -[main] -host = https://www.transifex.com - -[o:open-edx:p:openedx-translations:r:xblock-pdf] -file_filter = conf/locale//LC_MESSAGES/text.po -source_file = conf/locale/en/LC_MESSAGES/text.po -source_lang = en -type = PO From cba03eb1460621e600edbc8e90dc34cd496c3d43 Mon Sep 17 00:00:00 2001 From: farhan Date: Tue, 17 Nov 2026 10:52:07 +0500 Subject: [PATCH 3/3] build: fail extract_translations when any block fails The loop ran as one shell command whose exit code came from its last statement, so a failed i18n_tool, msgcat or mv was swallowed and make exited 0. The daily openedx-translations job could then commit a partial set of source files. Run the loop under set -e, with each step as its own statement so set -e catches it. Co-Authored-By: Claude Opus 5.5 --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 3950122f..d73fc436 100644 --- a/Makefile +++ b/Makefile @@ -36,13 +36,15 @@ requirements: ## install development environment requirements using uv ## Localization targets extract_translations: ## extract strings to be translated, outputting .po files under /conf/locale/ - @for xblock in $(XBLOCKS); do \ + @set -e; for xblock in $(XBLOCKS); do \ module_name=$$(basename $$xblock); \ echo "Extracting translations for $$module_name..."; \ - cd $$xblock && i18n_tool extract --no-segment; \ + cd $$xblock; \ + i18n_tool extract --no-segment; \ if [ -f $$xblock/$(EXTRACT_DIR)/djangojs.po ]; then \ msgcat $$xblock/$(EXTRACT_DIR)/django.po $$xblock/$(EXTRACT_DIR)/djangojs.po \ - -o $$xblock/$(EXTRACT_DIR)/django.po && rm -f $$xblock/$(EXTRACT_DIR)/djangojs.po; \ + -o $$xblock/$(EXTRACT_DIR)/django.po; \ + rm -f $$xblock/$(EXTRACT_DIR)/djangojs.po; \ fi; \ mkdir -p $(REPO_ROOT)/$$module_name/$(EXTRACT_DIR); \ if [ -f $$xblock/$(EXTRACT_DIR)/django.po ]; then \