Yaron Koresh commited on
Commit
fd34825
·
verified ·
1 Parent(s): 6e62ed2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -49,7 +49,8 @@ def translate(text,lang):
49
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15',
50
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 13_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15'
51
  ]
52
- query_text = f'Please translate {re.sub("[(^\-)(\-$)]","",text.replace("","-").replace("- -"," ")).strip()}, into {lang}'
 
53
  url = f'https://www.google.com/search?q={query_text}'
54
 
55
  print(url)
 
49
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15',
50
  'Mozilla/5.0 (Macintosh; Intel Mac OS X 13_1) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.1 Safari/605.1.15'
51
  ]
52
+ padded_chars = re.sub("[(^\-)(\-$)]","",text.replace("","-").replace("- -"," ")).strip()
53
+ query_text = f'Please translate {padded_chars}, into {lang}'
54
  url = f'https://www.google.com/search?q={query_text}'
55
 
56
  print(url)