use correct language code

This commit is contained in:
Adam Velebil 2023-11-02 10:33:17 +01:00
parent 80c510acbf
commit 45c521e818
No known key found for this signature in database
GPG Key ID: C9B1E4A3CBBD2E10

View File

@ -106,10 +106,10 @@ def update_arb_file(source_path, target_path, language_code):
if __name__ == "__main__":
source_file_path = 'lib/l10n/app_en.arb'
target_directory = 'lib/l10n'
language_code = os.path.basename(source_file_path).split('_')[1].split('.')[0]
for file_name in os.listdir(target_directory):
if file_name.startswith('app_') and file_name.endswith('.arb') and file_name != os.path.basename(source_file_path):
target_file_path = os.path.join(target_directory, file_name)
language_code = file_name.split('_')[1].split('.')[0]
update_arb_file(source_file_path, target_file_path, language_code)
print(f'File updated: {file_name}')