From 2b32231edaa8789e91d2d61e286eccfe978cf1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Ruz=20Nieto=20-=20MAC?= <40019177+aruznieto@users.noreply.github.com> Date: Fri, 8 Sep 2023 07:34:19 +0200 Subject: [PATCH] Minor fixes --- chameleonultragui/lib/l10n/update.py | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/chameleonultragui/lib/l10n/update.py b/chameleonultragui/lib/l10n/update.py index 1cafc04f..56ff4c8c 100644 --- a/chameleonultragui/lib/l10n/update.py +++ b/chameleonultragui/lib/l10n/update.py @@ -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: @@ -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)