Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crowdin/generate_android_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion crowdin/generate_desktop_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
3 changes: 2 additions & 1 deletion crowdin/generate_ios_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
4 changes: 4 additions & 0 deletions crowdin/generate_shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ def clean_string(text: str, is_android: bool, glossary_dict: Dict[str, str], ext
text = text.replace("&lt;/b&gt;", "</b>")
text = text.replace("&lt;/br&gt;", "\\n")
text = text.replace("<br/>", "\\n")
text = text.replace("&lt;span&gt;", '<font color="0">')
text = text.replace("&lt;/span&gt;", '</font>')
text = text.replace("<span>", '<font color="0">')
text = text.replace("</span>", '</font>')
text = text.replace("&", "&amp;") # Assume any remaining ampersands are desired
else:
text = html.unescape(text) # Unescape any HTML escaping
Expand Down