From 306788e25ece4504e76b675b19931dc9fe255070 Mon Sep 17 00:00:00 2001 From: GMAnon Date: Fri, 30 Dec 2022 18:20:19 -0300 Subject: [PATCH] Should lower the untranslated lines --- Auto Trans/Applier.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Auto Trans/Applier.py b/Auto Trans/Applier.py index 61bee12..8f0e75a 100644 --- a/Auto Trans/Applier.py +++ b/Auto Trans/Applier.py @@ -54,9 +54,8 @@ for file_name in os.listdir('scripts'): for line in lines: # Check if the line is commented out if not line.strip().startswith('#'): - # Iterate through the translations - for english_string, spanish_translation in translations.items(): - # Replace the English string with the translated string - line = line.replace(english_string, spanish_translation) + words = line.split('"')[1::2] + # Replace the English string with the translated string + line = line.replace(english_string, translations[words[-1]]) # Write the modified line to the output file output_file.write(line)