-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
revert: allow pulling translations by module name rather than repo name
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,46 +39,26 @@ jobs: | |
max-parallel: 1 | ||
matrix: | ||
repo: | ||
# Note: Add `python_module_name` for all edx-platform plugins and XBlocks such as DoneXBlock and completion, | ||
# but not for micrsoervices and IDAs such as course-discovery and credentials. | ||
- repo_name: AudioXBlock | ||
python_module_name: audio | ||
- repo_name: completion | ||
python_module_name: completion | ||
- repo_name: course-discovery # not a plugin | ||
- repo_name: credentials # not a plugin | ||
- repo_name: DoneXBlock | ||
python_module_name: done | ||
- repo_name: edx-ace | ||
python_module_name: edx_ace | ||
- repo_name: edx-bulk-grades | ||
python_module_name: bulk_grades | ||
- repo_name: edx-ora2 | ||
python_module_name: openassessment | ||
- repo_name: edx-proctoring | ||
python_module_name: edx_proctoring | ||
- repo_name: FeedbackXBlock | ||
python_module_name: feedback | ||
- repo_name: RecommenderXBlock | ||
python_module_name: recommender | ||
- repo_name: xblock-drag-and-drop-v2 | ||
python_module_name: drag_and_drop_v2 | ||
- repo_name: xblock-free-text-response | ||
python_module_name: freetextresponse | ||
- repo_name: xblock-google-drive | ||
python_module_name: google_drive | ||
- repo_name: xblock-image-explorer | ||
python_module_name: image_explorer | ||
- repo_name: xblock-image-modal | ||
python_module_name: imagemodal | ||
- repo_name: xblock-lti-consumer | ||
python_module_name: lti_consumer | ||
- repo_name: xblock-qualtrics-survey | ||
python_module_name: qualtricssurvey | ||
- repo_name: xblock-sql-grader | ||
python_module_name: sql_grader | ||
- repo_name: xblock-submit-and-compare | ||
python_module_name: submit_and_compare | ||
- AudioXBlock | ||
- completion | ||
- course-discovery | ||
- credentials | ||
- DoneXBlock | ||
- edx-ace | ||
- edx-bulk-grades | ||
- edx-ora2 | ||
- edx-proctoring | ||
- FeedbackXBlock | ||
- RecommenderXBlock | ||
- xblock-drag-and-drop-v2 | ||
- xblock-free-text-response | ||
- xblock-google-drive | ||
- xblock-image-explorer | ||
- xblock-image-modal | ||
- xblock-lti-consumer | ||
- xblock-qualtrics-survey | ||
- xblock-sql-grader | ||
- xblock-submit-and-compare | ||
|
||
runs-on: ubuntu-latest | ||
continue-on-error: true | ||
|
@@ -96,11 +76,11 @@ jobs: | |
run: sudo apt install -y gettext | ||
|
||
# Clones the repository | ||
- name: clone openedx/${{ matrix.repo.repo_name }} | ||
- name: clone openedx/${{ matrix.repo }} | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: openedx/${{ matrix.repo.repo_name }} | ||
path: translations/${{ matrix.repo.repo_name }} | ||
repository: openedx/${{ matrix.repo }} | ||
path: translations/${{ matrix.repo }} | ||
|
||
# Sets up Python | ||
- name: setup python | ||
|
@@ -115,13 +95,13 @@ jobs: | |
# Extracts the translation source files | ||
- name: extract translation source files | ||
run: | | ||
cd translations/${{ matrix.repo.repo_name }} | ||
cd translations/${{ matrix.repo }} | ||
make extract_translations | ||
# Validate compilation of translation source files | ||
- name: validate compilation of translation source files | ||
run: | | ||
cd translations/${{ matrix.repo.repo_name }} | ||
cd translations/${{ matrix.repo }} | ||
django-admin compilemessages --locale en | ||
# git adds only the translation source files, found in conf/locale/en | ||
|
@@ -131,19 +111,19 @@ jobs: | |
# set identity | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "edx-transifex-bot" | ||
# Change directory to translations/${{ matrix.repo.repo_name }} | ||
cd translations/${{ matrix.repo.repo_name }} | ||
# Change directory to translations/${{ matrix.repo }} | ||
cd translations/${{ matrix.repo }} | ||
# finds the directory containing the english locale usually located in | ||
# */*/conf/locale/en | ||
EN_DIR=$(find . -type d -regex ".+conf\/locale\/en$") | ||
# If the directory is not found, exit with an error. This can happen if we add a repository that doesn't | ||
# comply with OEP-58, or it still doesn't have any translations yet | ||
if [ -z "$EN_DIR" ]; then | ||
echo "Missing English locale directory for ${{ matrix.repo.repo_name }}!" | ||
echo "Missing English locale directory for ${{ matrix.repo }}!" | ||
echo "exiting with error!" | ||
exit 1 | ||
fi | ||
# remove translations/${{ matrix.repo.repo_name }}/.git so we don't commit a submodule | ||
# remove translations/${{ matrix.repo }}/.git so we don't commit a submodule | ||
rm -rf .git | ||
# finds the django.po and djangojs.po files generated by make | ||
# extract_translations into EN_DIR and adds them | ||
|
@@ -170,21 +150,12 @@ jobs: | |
# Check the git statuses of the translation source files | ||
echo "GIT_STATUS=$(git status $DJANGO_PATH $DJANGOJS_PATH -s | wc -l)" >> $GITHUB_ENV | ||
- name: create plugin/xblock link | ||
if: ${{ matrix.repo.python_module_name }} | ||
run: | | ||
cd translations/edx-platform-links | ||
if [ ! -d "${{ matrix.repo.python_module_name }}" ]; then | ||
ln -sd ../${{ matrix.repo.repo_name }}/${{ matrix.repo.python_module_name }} ${{ matrix.repo.python_module_name }} | ||
git add ${{ matrix.repo.python_module_name }} | ||
fi | ||
# Attempts to commit the translation source files if there is a difference | ||
- name: git commit the translation source files | ||
if: "${{ env.GIT_STATUS > 0 }}" | ||
run: | | ||
# commit the changes | ||
git commit -m "chore: add extracted translation source files from ${{ matrix.repo.repo_name }}" | ||
git commit -m "chore: add extracted translation source files from ${{ matrix.repo }}" | ||
# push changes to branch | ||
git push | ||
|
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.