Skip to content

Commit

Permalink
feat: Special support for XBlocks
Browse files Browse the repository at this point in the history
XBlocks require text.po and textjs.po instead of django.po and djangojs.po

Refs: FC-0012 OEP-58
  • Loading branch information
shadinaif committed Aug 24, 2023
1 parent 39611ef commit b4e34f0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/extract-translation-source-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,22 @@ 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
DJANGO_PATH=$(dirname $DJANGO_PATH)/django.po
fi
if [ ! -z "$DJANGOJS_PATH" ]; then
mv $DJANGOJS_PATH $(dirname $DJANGOJS_PATH)/djangojs.po
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
Expand Down

0 comments on commit b4e34f0

Please sign in to comment.