diff --git a/.github/workflows/extract-translation-source-files.yml b/.github/workflows/extract-translation-source-files.yml index 1b55b3dba23..2b349152cb1 100644 --- a/.github/workflows/extract-translation-source-files.yml +++ b/.github/workflows/extract-translation-source-files.yml @@ -149,6 +149,20 @@ jobs: # extract_translations into EN_DIR and adds them DJANGO_PATH=$(find $EN_DIR -name 'django.po') DJANGOJS_PATH=$(find $EN_DIR -name 'djangojs.po') + ############## Special support for XBlocks + # if both files are not found, then it can be an XBlock (thus, text.po and textjs.po files) + if [ -z "$DJANGO_PATH" ] && [ -z "$DJANGOJS_PATH" ]; then + DJANGO_PATH=$(find $EN_DIR -name 'text.po') + DJANGOJS_PATH=$(find $EN_DIR -name 'textjs.po') + # Rename the files to django.po and djangojs.po, if exists + if [ ! -z "$DJANGO_PATH" ]; then + mv $DJANGO_PATH $(dirname $DJANGO_PATH)/django.po + fi + if [ ! -z "$DJANGOJS_PATH" ]; then + mv $DJANGOJS_PATH $(dirname $DJANGOJS_PATH)/djangojs.po + fi + fi + ############## End of - Special support for XBlocks # use (-f) to force add the files even if they are ignored in the source repo git add $DJANGO_PATH $DJANGOJS_PATH -f -v # Check the git statuses of the translation source files