diff --git a/crowdin/generate_android_strings.py b/crowdin/generate_android_strings.py index b3bbc48..67f8f96 100644 --- a/crowdin/generate_android_strings.py +++ b/crowdin/generate_android_strings.py @@ -136,7 +136,8 @@ def convert_non_translatable_strings_to_kotlin(input_file, output_path): for key_lowercase in glossary_dict: key = key_lowercase.upper() text = glossary_dict[key_lowercase] - file.write(f' const val {key:<{max_key_length}} = "{text}"\n') + cleaned_text = clean_string(text, True, glossary_dict, {}) + file.write(f' const val {key:<{max_key_length}} = "{cleaned_text}"\n') file.write('}\n') file.write('\n') diff --git a/crowdin/generate_desktop_strings.py b/crowdin/generate_desktop_strings.py index 9452928..2d4c20f 100644 --- a/crowdin/generate_desktop_strings.py +++ b/crowdin/generate_desktop_strings.py @@ -126,7 +126,8 @@ def convert_non_translatable_strings_to_type_script(input_file: str, output_path file.write('export enum LOCALE_DEFAULTS {\n') for key in glossary_dict: text = glossary_dict[key] - file.write(f" {key} = '{text}',\n") + cleaned_text = clean_string(text, False, glossary_dict, {}) + file.write(f" {key} = '{cleaned_text}',\n") file.write('}\n') file.write('\n') diff --git a/crowdin/generate_ios_strings.py b/crowdin/generate_ios_strings.py index c8d6000..6029646 100644 --- a/crowdin/generate_ios_strings.py +++ b/crowdin/generate_ios_strings.py @@ -244,7 +244,8 @@ def convert_non_translatable_strings_to_swift(input_file, output_paths): file.write(f'public enum {enum_name} {{\n') for key in glossary_dict: text = glossary_dict[key] - file.write(f' public static let {key}: String = "{text}"\n') + cleaned_text = clean_string(text, False, glossary_dict, {}) + file.write(f' public static let {key}: String = "{cleaned_text}"\n') file.write('}\n') diff --git a/crowdin/generate_shared.py b/crowdin/generate_shared.py index a455f37..ae22db8 100644 --- a/crowdin/generate_shared.py +++ b/crowdin/generate_shared.py @@ -17,6 +17,10 @@ def clean_string(text: str, is_android: bool, glossary_dict: Dict[str, str], ext text = text.replace("</b>", "") text = text.replace("</br>", "\\n") text = text.replace("
", "\\n") + text = text.replace("<span>", '') + text = text.replace("</span>", '') + text = text.replace("", '') + text = text.replace("", '') text = text.replace("&", "&") # Assume any remaining ampersands are desired else: text = html.unescape(text) # Unescape any HTML escaping