diff --git a/translator.py b/translator.py index 86e6d99..39e10ac 100644 --- a/translator.py +++ b/translator.py @@ -118,8 +118,8 @@ def translate_ios_infoplist_strings(): result = response.json() 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}";' # Ensure translated string is always within quotes + translated_text = translated_text.replace('"', '') # Escape quotes in translated text + translated_line = f'{key} = "{translated_text.strip()}";' # Ensure translated string is always within quotes translated_file.write(translated_line + '\n') print(f"{value} --> {translated_text}") else: