Skip to content

Commit

Permalink
Fix Crowdin Download action
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkeye116477 committed Oct 27, 2024
1 parent 0fd6c90 commit 5db6c9a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/crowdin_download.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ jobs:
- name: Install and Configure Python
shell: bash
run: |
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install lxml requests crowdin-api-client
pip install lxml requests crowdin-api-client --no-cache-dir
- name: Download translations from Crowdin
run: |
source .venv/bin/activate
python3 ./make_scripts/download_translations.py
env:
crowdin_project_id: ${{ secrets.CROWDIN_PROJECT_ID }}
Expand Down
7 changes: 5 additions & 2 deletions make_scripts/download_translations.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import shutil
import tempfile
from zipfile import ZipFile
import requests
Expand Down Expand Up @@ -59,12 +60,14 @@ class FirstCrowdinClient(CrowdinClient):
if line := line.strip():
legendary_loc_keys[line] = ""

legendary_loc_path = pj(tmpdirname)
legendary_loc_path = pj(tmpdirname, "src", "Localization")
for filename in os.listdir(legendary_loc_path):
path = os.path.join(legendary_loc_path, filename)
if os.path.isdir(path):
continue
if "legendary" in filename:
if any(x in filename for x in ["legendary", "gog-oss"]):
if "gog-oss" in filename:
shutil.copy(path, pj(src_path, "Localization"))
continue
legendary_loc = ET.parse(pj(legendary_loc_path, filename))

Expand Down

0 comments on commit 5db6c9a

Please sign in to comment.