Skip to content

Commit

Permalink
Minor fixes (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
aruznieto authored Sep 8, 2023
1 parent e0fe4e9 commit 49c52cb
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions chameleonultragui/lib/l10n/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ def request(method, url, data=None):
'Content-Type': 'application/json'})).read().decode())


LANGUAGES = request('GET', 'https://crowdin.com/api/v2/languages?limit=500')['data']

for language in progressbar(
request('GET', 'https://crowdin.com/api/v2/projects/611911/files/33/languages/progress?limit=500')['data']):
try:
Expand All @@ -43,9 +41,5 @@ def request(method, url, data=None):
'skipUntranslatedStrings': True, 'fileIds': [33]})
export = urlopen(Request(translation['data']['url'], method='GET')).read()
translations = json.loads(export.decode())
locale = None
for lang in LANGUAGES:
if lang['data']['id'] == language['data']['languageId']:
locale = lang['data']['osxLocale'].replace('-', '_')
translations['@@locale'] = locale
locale = translations['@@locale']
json.dump(translations, open(f'app_{locale}.arb', 'w+'), indent=2)

0 comments on commit 49c52cb

Please sign in to comment.