Skip to content

Commit

Permalink
Merge pull request #593 from Zeit-Labs/shadinaif/FC-0012-OEP-58.suppo…
Browse files Browse the repository at this point in the history
…rt-xblocks

feat: Special support for XBlocks
  • Loading branch information
OmarIthawi authored Aug 31, 2023
2 parents 0078995 + 0fa68f0 commit fbc8ab0
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 [ -n "$DJANGO_PATH" ]; then
mv $DJANGO_PATH $(dirname $DJANGO_PATH)/django.po
DJANGO_PATH=$(dirname $DJANGO_PATH)/django.po
fi
if [ -n "$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 fbc8ab0

Please sign in to comment.