Skip to content

Commit

Permalink
Merge pull request #27 from oxen-io/fix/unicode_arrows_no_ampersand_s…
Browse files Browse the repository at this point in the history
…pace

Also replace non-escaped arrows
  • Loading branch information
mpretty-cyro authored Sep 18, 2024
2 parents f861f47 + 26a180b commit 9f2ebc6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crowdin/generate_android_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ def clean_string(text):
text = text.replace("&lt;/b&gt;", "</b>")
text = text.replace("&lt;/br&gt;", "\\n")
text = text.replace("-&gt;", "→") # Use the special unicode for arrows
text = text.replace("->", "→") # Use the special unicode for arrows
text = text.replace("&lt;-", "←") # Use the special unicode for arrows
text = text.replace("<-", "←") # Use the special unicode for arrows
text = text.replace("<br/>", "\\n")
text = text.replace("&", "&amp;") # Assume any remaining ampersands are desired
return text.strip() # Strip whitespace
Expand Down
2 changes: 2 additions & 0 deletions crowdin/generate_desktop_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def parse_xliff(file_path):

def clean_string(text):
text = text.replace("-&gt;", "→") # Use the special unicode for arrows
text = text.replace("->", "→") # Use the special unicode for arrows
text = text.replace("&lt;-", "←") # Use the special unicode for arrows
text = text.replace("<-", "←") # Use the special unicode for arrows
text = html.unescape(text) # Unescape any HTML escaping
return text.strip() # Strip whitespace

Expand Down
2 changes: 2 additions & 0 deletions crowdin/generate_ios_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ def parse_xliff(file_path):

def clean_string(text):
text = text.replace("-&gt;", "→") # Use the special unicode for arrows
text = text.replace("->", "→") # Use the special unicode for arrows
text = text.replace("&lt;-", "←") # Use the special unicode for arrows
text = text.replace("<-", "←") # Use the special unicode for arrows
text = html.unescape(text) # Unescape any HTML escaping
return text.strip() # Strip whitespace

Expand Down

0 comments on commit 9f2ebc6

Please sign in to comment.