No translation was found using the current translator. Try another translator?
"No translation was found using the current translator. Try another translator?" - the library wrote to me and the code stopped. It started yesterday and continues to this day.
Code snippet:
# Text translation function from Russian to English
def translate_to_english(text):
return Google Translator(source='ru', target='en').translate(text)
# The function of translating text from English to Russian
def translate_to_russian(text):
return GoogleTranslator(source='en', target='ru').translate(text)
Is the library not working only for me? I looked at it, it's the same on all devices and on all translators. At first, there was a feeling that Google was covering up the requests with a good curse and sending them to hell. But it turned out that others don't work either, like "MyMemoryTranslator". I do not deny that it could have been done by my authorities or sanctions, since I am from Russia. But individually, all the translators in the browser are working and the connection with them is stable. DPI is also missing. (just don't kick me, I don't know anything about networking.)
Please help me :(
Same problem for me. I tried to translate "Hello" text from 2 different IP and devices but result is the same. Before this happens, I was getting really bad translations. IG something wrong with the package for 2-3 days.
Same for me. I've tried many times but i got the same result. "No translation was found using the current translator. Try another translator?"
Нихрена не работает, вчера вообще перестало работать. Сегодня вернулось - но всё такой же дословный перевод, как и до "отключения"
My problem was solved, what about yours?
Mine solved too. Hopefully it doesn't repeat again
I am currently facing this issue as well, and I am using Google Translate.
same prob google engineers xd, no longer WLB
I'm just getting "Error 500 (Server Error)!!1500.That’s an error.There was an error. Please try again later.That’s all we know." in a function that had been running well for a year.
Previous days this happened intermittently, now it's constant.
I'm just getting "Error 500 (Server Error)!!1500.That’s an error.There was an error. Please try again later.That’s all we know." in a function that had been running well for a year.
Previous days this happened intermittently, now it's constant.
This is the same issue with previous one(3 days ago). Its not about with the package but the google.
Try this https://github.com/nidhaloff/deep-translator/pull/290
OK "Error 500 (Server Error)!!1500.That’s an error.There was an error. Please try again later.That’s all we know." problem
onetime instant patch
ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) \
AppleWebKit/537.36 (KHTML, like Gecko) \
Chrome/116.0.0.0 Safari/537.36 Edg/116.0.1938.81" # example
#----- ----- ----- -----
import requests
from requests import Session
# Save the original send method
_original_send = Session.send
def _patched_send(*args, **kwargs):
"""
Patched send method that automatically adds User-Agent header
"""
# Get the request object
request = args[1]
# Set default User-Agent if not provided
if 'User-Agent' not in request.headers:
request.headers['User-Agent'] = DEFAULT_USER_AGENT
# Call original send method
return _original_send(*args, **kwargs)
# Default User-Agent string
DEFAULT_USER_AGENT = ua
def apply_patch(user_agent=None):
"""
Apply User-Agent patch to requests
:param user_agent: Custom User-Agent string (optional)
"""
global DEFAULT_USER_AGENT
if user_agent:
DEFAULT_USER_AGENT = user_agent
# Apply patch only if not already applied
if Session.send != _patched_send:
Session.send = _patched_send
def remove_patch():
"""Restore original send method"""
if Session.send == _patched_send:
Session.send = _original_send
# Apply patch automatically when module loads (optional)
apply_patch()
#----- ----- ----- -----
it seems like this issue is still here, anyone how to solve it or pull request?
it seems like this issue is still here, anyone how to solve it or pull request?
I have been testing this for 5 to 6 hours and the patch works for me. Removing the patch immediately shows the error. I've also tested bulk text translation
fixed? I got no erorr message with no onetime patch.
fixed? I got no erorr message with no onetime patch.
I did the patch for google translate only and your patch does the same for all reqs. This should fix the error
there is no error messages. very good.
there is no error messages. very good.
hello where should we edit for the patch part? may i know the path for the locaiton?
there is no error messages. very good.
hello where should we edit for the patch part? may i know the path for the locaiton?
Maybe it has already patched by xpz3.
problem is(was) Google server wants browser's User-Agent infomation.So we need add headers to requests.get() .
If it is not fixed ... example
Just example It is not correct.Conceptual example
from deep_translator import GoogleTranslator
import requests
class CustomUserAgentGoogleTranslator(GoogleTranslator):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.headers = {
'User-Agent': 'Mozilla/5.0 (Custom Agent)', # Custom User-Agent
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
}
def translate(self, text, **kwargs):
# Original parameter generation logic
url = "https://translate.google.com/translate_a/single"
params = self._prepare_params(text)
# Execute request (apply custom headers)
response = requests.get(
url,
params=params,
headers=self.headers, # Specify custom headers
proxies=self.proxies,
timeout=self.timeout
)
# Response processing
return self._parse_response(response.text)
# Example usage
translator = CustomUserAgentGoogleTranslator(source='en', target='ja')
print(translator.translate("hello"))
there is no error messages. very good.
hello where should we edit for the patch part? may i know the path for the locaiton?
Goto your deep translator location and find the file google.py. open a terminal in that folder. Then apply this patch by running
patch -p1 < 3d2af63ea43d44eb19473e056a0716c2687d0fdd.patch
Download the patch here
If you cannot find the location, you can run deep translator and the error will show you the path to the installation.
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
What's wrong with quality? It's the same translation that you get on website. Are you saying that the translations are different on translate.google.com and translate.google.com/m ?
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
What's wrong with quality? It's the same translation that you get on website. Are you saying that the translations are different on translate.google.com and translate.google.com/m ?
Yeah, until a few days ago there were no changes in quality, but now there are... The quality is significantly worse compared to the website. For example:
translate.google.com: Ko: 엑스칼리버 뽑습니다 En: Pull out Excalibur.
Translate.google.com/m: Ko: 엑스칼리버 뽑습니다 En: Excalibur.
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
What's wrong with quality? It's the same translation that you get on website. Are you saying that the translations are different on translate.google.com and translate.google.com/m ?
Yeah, until a few days ago there were no changes in quality, but now there are... The quality is significantly worse compared to the website. For example:
translate.google.com: Ko: 엑스칼리버 뽑습니다 En: Pull out Excalibur.
Translate.google.com/m: Ko: 엑스칼리버 뽑습니다 En: Excalibur.
Try this translate.google.com Web Translation Script
This would not be as fast as the other api
# Requirement: pip3 install setuptools selenium undetected-chromedriver
#Example usage
#driver_wait is the time set to load the webpage fully. If set to zero may end up in no translation found error.
translator = GoogleTranslatorWeb(headless=True, driver_wait=3)
text = "Hello"
translated = translator.translate(text, source_lang="auto", target_lang="es")
print(f"Translated: {translated}")
translator.close()
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
What's wrong with quality? It's the same translation that you get on website. Are you saying that the translations are different on translate.google.com and translate.google.com/m ?
Yeah, until a few days ago there were no changes in quality, but now there are... The quality is significantly worse compared to the website. For example: translate.google.com: Ko: 엑스칼리버 뽑습니다 En: Pull out Excalibur. Translate.google.com/m: Ko: 엑스칼리버 뽑습니다 En: Excalibur.
Try this translate.google.com Web Translation Script
This would not be as fast as the other api
# Requirement: pip3 install setuptools selenium undetected-chromedriver #Example usage #driver_wait is the time set to load the webpage fully. If set to zero may end up in no translation found error. translator = GoogleTranslatorWeb(headless=False, driver_wait=3) text = "Hello" translated = translator.translate(text, source_lang="auto", target_lang="es") print(f"Translated: {translated}") translator.close()
I tried your web script directly from your fork. If used with headless=False, the translation is high-quality, but 3 seconds to wait may not be enough, and with each request a new chrome window opens and as a result, there are dozens of them after a while.
With headless=True, the translation is still bad, and with each request a process opens in the background that then does not close and as a result, after a while, either the memory or the CPU is filled.
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
What's wrong with quality? It's the same translation that you get on website. Are you saying that the translations are different on translate.google.com and translate.google.com/m ?
Yeah, until a few days ago there were no changes in quality, but now there are... The quality is significantly worse compared to the website. For example: translate.google.com: Ko: 엑스칼리버 뽑습니다 En: Pull out Excalibur. Translate.google.com/m: Ko: 엑스칼리버 뽑습니다 En: Excalibur.
Try this translate.google.com Web Translation Script This would not be as fast as the other api
# Requirement: pip3 install setuptools selenium undetected-chromedriver #Example usage #driver_wait is the time set to load the webpage fully. If set to zero may end up in no translation found error. translator = GoogleTranslatorWeb(headless=False, driver_wait=3) text = "Hello" translated = translator.translate(text, source_lang="auto", target_lang="es") print(f"Translated: {translated}") translator.close()I tried your web script directly from your fork. If used with headless=False, the translation is high-quality, but 3 seconds to wait may not be enough, and with each request a new chrome window opens and as a result, there are dozens of them after a while.
With headless=True, the translation is still bad, and with each request a process opens in the background that then does not close and as a result, after a while, either the memory or the CPU is filled.
https://github.com/nidhaloff/deep-translator/issues/283#issue-2837411545 i used the Japanese text from this post and with both headless and gui mode i get the same translation. The translation is only different when using apis. I'll look into the the process not getting closed. And yes 3 seconds may not be enough on some systems. That's why i left the comment.
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
What's wrong with quality? It's the same translation that you get on website. Are you saying that the translations are different on translate.google.com and translate.google.com/m ?
Yeah, until a few days ago there were no changes in quality, but now there are... The quality is significantly worse compared to the website. For example: translate.google.com: Ko: 엑스칼리버 뽑습니다 En: Pull out Excalibur. Translate.google.com/m: Ko: 엑스칼리버 뽑습니다 En: Excalibur.
Try this translate.google.com Web Translation Script This would not be as fast as the other api
# Requirement: pip3 install setuptools selenium undetected-chromedriver #Example usage #driver_wait is the time set to load the webpage fully. If set to zero may end up in no translation found error. translator = GoogleTranslatorWeb(headless=False, driver_wait=3) text = "Hello" translated = translator.translate(text, source_lang="auto", target_lang="es") print(f"Translated: {translated}") translator.close()I tried your web script directly from your fork. If used with headless=False, the translation is high-quality, but 3 seconds to wait may not be enough, and with each request a new chrome window opens and as a result, there are dozens of them after a while.
With headless=True, the translation is still bad, and with each request a process opens in the background that then does not close and as a result, after a while, either the memory or the CPU is filled.
Quick question, did you forget translator.close() after translation?
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
What's wrong with quality? It's the same translation that you get on website. Are you saying that the translations are different on translate.google.com and translate.google.com/m ?
Yeah, until a few days ago there were no changes in quality, but now there are... The quality is significantly worse compared to the website. For example: translate.google.com: Ko: 엑스칼리버 뽑습니다 En: Pull out Excalibur. Translate.google.com/m: Ko: 엑스칼리버 뽑습니다 En: Excalibur.
Try this translate.google.com Web Translation Script This would not be as fast as the other api
# Requirement: pip3 install setuptools selenium undetected-chromedriver #Example usage #driver_wait is the time set to load the webpage fully. If set to zero may end up in no translation found error. translator = GoogleTranslatorWeb(headless=False, driver_wait=3) text = "Hello" translated = translator.translate(text, source_lang="auto", target_lang="es") print(f"Translated: {translated}") translator.close()I tried your web script directly from your fork. If used with headless=False, the translation is high-quality, but 3 seconds to wait may not be enough, and with each request a new chrome window opens and as a result, there are dozens of them after a while. With headless=True, the translation is still bad, and with each request a process opens in the background that then does not close and as a result, after a while, either the memory or the CPU is filled.
Quick question, did you forget translator.close() after translation?
Whops, my bad. Now is work fine. But anyway in headless i get a bad translation. I translate from English to other languages and this is what I get.
Original: How can I help you today?
In headless: japanese: 今日はどうすればお手伝いできますか? Russian: Как я могу вам помочь сегодня? German: Wie kann ich Ihnen heute helfen? French: Comment puis-je vous aider aujourd'hui?
Not headless: japanese: 今日はどのようなご用件でしょうか? Russian: Чем я могу вам помочь сегодня? German: Wie kann ich Ihnen heute helfen? French: Comment puis-je vous aider aujourd'hui?
As you can see, the translation is different. The second case is more correct and corresponds to the translation from the site. If you make longer sentences, you get the feeling that it translates phrases of 3-4 words, and not the entire sentence or text as a whole.
The issue is fixed but the translation quality is still not so promising for me. Is there anyone who has the same issue?
What's wrong with quality? It's the same translation that you get on website. Are you saying that the translations are different on translate.google.com and translate.google.com/m ?
Yeah, until a few days ago there were no changes in quality, but now there are... The quality is significantly worse compared to the website. For example: translate.google.com: Ko: 엑스칼리버 뽑습니다 En: Pull out Excalibur. Translate.google.com/m: Ko: 엑스칼리버 뽑습니다 En: Excalibur.
Try this translate.google.com Web Translation Script This would not be as fast as the other api
# Requirement: pip3 install setuptools selenium undetected-chromedriver #Example usage #driver_wait is the time set to load the webpage fully. If set to zero may end up in no translation found error. translator = GoogleTranslatorWeb(headless=False, driver_wait=3) text = "Hello" translated = translator.translate(text, source_lang="auto", target_lang="es") print(f"Translated: {translated}") translator.close()I tried your web script directly from your fork. If used with headless=False, the translation is high-quality, but 3 seconds to wait may not be enough, and with each request a new chrome window opens and as a result, there are dozens of them after a while. With headless=True, the translation is still bad, and with each request a process opens in the background that then does not close and as a result, after a while, either the memory or the CPU is filled.
Quick question, did you forget translator.close() after translation?
Whops, my bad. Now is work fine. But anyway in headless i get a bad translation. I translate from English to other languages and this is what I get.
Original: How can I help you today?
In headless: japanese: 今日はどうすればお手伝いできますか? Russian: Как я могу вам помочь сегодня? German: Wie kann ich Ihnen heute helfen? French: Comment puis-je vous aider aujourd'hui?
Not headless: japanese: 今日はどのようなご用件でしょうか? Russian: Чем я могу вам помочь сегодня? German: Wie kann ich Ihnen heute helfen? French: Comment puis-je vous aider aujourd'hui?
As you can see, the translation is different. The second case is more correct and corresponds to the translation from the site. If you make longer sentences, you get the feeling that it translates phrases of 3-4 words, and not the entire sentence or text as a whole.
Ill test the same text and get back later today.
Is there still no solution to the problem?
i think the issue is now fixed, but the quality of the translation is still bad, I am experiencing the same issue where the google translation only translate a few words and stop, this will make the whole paragraph no sense