Skip to content

Commit

Permalink
Merge pull request #147 from digitalearthafrica/nanaboamah89-patch-2
Browse files Browse the repository at this point in the history
Update main.yml
  • Loading branch information
nanaboamah89 authored Nov 15, 2024
2 parents 8d63c74 + 945278a commit 6c99bf3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,19 @@ jobs:
POEDITOR_PROJECT_ID: "715168"
run: |
python upload_terms.py
# Run the download_terms.py script
python download_terms.py
# Stage the downloaded translation files
git add locales/fr/LC_MESSAGES/docs.po
# Check if there are any changes that are staged but not committed.
if [[ "$(git diff --cached --exit-code)" = "" ]]; then
echo "Nothing to commit, working tree clean";
else
# Commit the changes
git commit -m "Auto update deafrica-tools french translation files"
# Update the branch
git push
fi
3 changes: 1 addition & 2 deletions download_translations.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ def download_translation(file_path, project_id, api_token):
file_type='po',
local_file=file_path,
)

if __name__ == '__main__':
project_id = os.environ['POEDITOR_PROJECT_ID']
api_token = os.environ['POEDITOR_API_TOKEN']
api_token = os.environ['POEDITOR_API_TOKEN']

file_path = 'locales/fr/LC_MESSAGES/docs.po'
print(f"Downloading translation to {file_path}")
Expand Down

0 comments on commit 6c99bf3

Please sign in to comment.