From 357ebc154b6e430d8f1c804bcd6db4eb94d73e20 Mon Sep 17 00:00:00 2001 From: zoltanvb <101990835+zoltanvb@users.noreply.github.com> Date: Tue, 27 Dec 2022 21:42:00 +0100 Subject: [PATCH] Remove () from language names. (#14771) --- intl/fetch_progress.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intl/fetch_progress.py b/intl/fetch_progress.py index d9656769ab..293690a366 100755 --- a/intl/fetch_progress.py +++ b/intl/fetch_progress.py @@ -18,7 +18,8 @@ with open("crowdin.yaml", 'r') as config_file: lang_name = res2.json()['data']['name'] output += '/* ' + lang_name + ' */\n' - escaped_name = lang_name.replace(', ', '_').replace(' ', '_').upper() + replacements = lang_name.maketrans(' ', '_', ',()') + escaped_name = lang_name.translate(replacements).upper() output += '#define LANGUAGE_PROGRESS_' + escaped_name + '_TRANSLATED ' + str(lang['data']['translationProgress']) + '\n' output += '#define LANGUAGE_PROGRESS_' + escaped_name + '_APPROVED ' + str(lang['data']['approvalProgress']) + '\n\n' with open("progress.h", 'w') as output_file: