Skip to content

Commit

Permalink
translator fix to avoid mistakes with quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
Javier Manrique committed Dec 2, 2024
1 parent 6a38768 commit a39de7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion translator.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def translate_ios_infoplist_strings():

translated_text = result.get("translations", [{}])[0].get("text", "").strip().rstrip('。;')
translated_text = translated_text.replace('"', '\"') # Escape quotes in translated text
translated_line = f'{key} = "{translated_text.rstrip(';')}";' # Ensure translated string is always within quotes
translated_line = f'{key} = "{translated_text}";' # Ensure translated string is always within quotes
translated_file.write(translated_line + '\n')
print(f"{value} --> {translated_text}")
else:
Expand Down

0 comments on commit a39de7c

Please sign in to comment.