From 01649fb0810e8947fa829a713315a6210b4a1d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Ruz=20Nieto?= <40019177+aruznieto@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:32:11 +0200 Subject: [PATCH] Update Crowding parser (#209) --- chameleonultragui/lib/l10n/updateCrowdin.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/chameleonultragui/lib/l10n/updateCrowdin.py b/chameleonultragui/lib/l10n/updateCrowdin.py index 0ab5746b..378f4812 100644 --- a/chameleonultragui/lib/l10n/updateCrowdin.py +++ b/chameleonultragui/lib/l10n/updateCrowdin.py @@ -26,11 +26,12 @@ def request(method, url, data=None): 'Content-Type': 'application/json'})).read().decode()) def add_string_to_source(string): + print(string) projectId = 611911 sourceId = 33 try: - string_parsed = string.split('+++ chameleonultragui/lib/l10n/app_en.arb ', 1)[1].replace(' ', '').replace(',', '').replace('\n','').split('+')[1:] + string_parsed = string.split('app_en.arb', 1)[1].replace(' ', '').replace(',', '').replace('\n','').split('+')[1:] for s in string_parsed: data = {'identifier': key.replace('"', ''), 'text': value.replace('"', ''), 'fileId': sourceId} try: @@ -40,7 +41,7 @@ def add_string_to_source(string): except Exception as e: print(e) - except: + except Exception as e: print(e) if __name__ == "__main__":