Skip to content

Commit

Permalink
Fix translations workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxushka authored Sep 10, 2023
1 parent abd4b3e commit 79e0713
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions chameleonultragui/lib/l10n/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ def request(method, url, data=None):
f"https://crowdin.com/api/v2/projects/611911/languages/{language['data']['languageId']}/progress")
except urllib.error.HTTPError:
continue
if progress['data'][0]['data']['words']['translated']/progress['data'][0]['data']['words']['total'] >= 0.7:
translation = request('POST', 'https://crowdin.com/api/v2/projects/611911/translations/exports',
{'targetLanguageId': language['data']['languageId'], 'format': 'arb-export',
'skipUntranslatedStrings': True, 'fileIds': [33]})
if progress['data'][0]['data']['words']['translated'] / progress['data'][0]['data']['words']['total'] >= 0.7:
try:
translation = request('POST', 'https://crowdin.com/api/v2/projects/611911/translations/exports',
{'targetLanguageId': language['data']['languageId'], 'format': 'arb-export',
'skipUntranslatedStrings': True, 'fileIds': [33]})
except urllib.error.HTTPError:
continue
export = urlopen(Request(translation['data']['url'], method='GET')).read()
translations = json.loads(export.decode())
locale = translations['@@locale']
Expand Down

0 comments on commit 79e0713

Please sign in to comment.