Spaces:
Running
Running
Yaron Koresh
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,8 +1,3 @@
|
|
1 |
-
"""
|
2 |
-
Modified parts included from these sources:
|
3 |
-
- https://github.com/nidhaloff/deep-translator
|
4 |
-
"""
|
5 |
-
|
6 |
import urllib
|
7 |
import requests
|
8 |
from bs4 import BeautifulSoup
|
@@ -646,6 +641,8 @@ def add_text_above_image(img,top_title=None,bottom_title=None):
|
|
646 |
|
647 |
return img
|
648 |
|
|
|
|
|
649 |
google_translate_endpoint = "https://translate.google.com/m"
|
650 |
language_codes = {
|
651 |
"afrikaans": "af",
|
@@ -1235,6 +1232,8 @@ class GoogleTranslator(BaseTranslator):
|
|
1235 |
"""
|
1236 |
return self._translate_batch(batch, **kwargs)
|
1237 |
|
|
|
|
|
1238 |
def translate(txt,to_lang="en",from_lang="auto"):
|
1239 |
log(f'CALL translate')
|
1240 |
if len(txt) == 0:
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import urllib
|
2 |
import requests
|
3 |
from bs4 import BeautifulSoup
|
|
|
641 |
|
642 |
return img
|
643 |
|
644 |
+
# Modified parts from https://github.com/nidhaloff/deep-translator:
|
645 |
+
|
646 |
google_translate_endpoint = "https://translate.google.com/m"
|
647 |
language_codes = {
|
648 |
"afrikaans": "af",
|
|
|
1232 |
"""
|
1233 |
return self._translate_batch(batch, **kwargs)
|
1234 |
|
1235 |
+
# End of "Modified parts from https://github.com/nidhaloff/deep-translator"
|
1236 |
+
|
1237 |
def translate(txt,to_lang="en",from_lang="auto"):
|
1238 |
log(f'CALL translate')
|
1239 |
if len(txt) == 0:
|