The example function is not working. First, I use the following code
from translatepy import Translator
translate = Translator()
print(translate.example("Hello", "German", "English"))
which gives the following error.
Traceback (most recent call last):
File "C:\Users\femustafa\Desktop\Language app\main.py", line 81, in <module>
print(translate.example("Hello", "German", "English"))
File "C:\Users\femustafa\Desktop\Language app\.venv\lib\site-packages\translatepy\translate.py", line 363, in example
raise NoResult("No service has returned a valid result")
translatepy.exceptions.NoResult: No service has returned a valid result
As example function is not implemented for all translators. I just use Bing translator
from translatepy.translators.bing import BingTranslate
translate = BingTranslate()
print(translate.example("Hello", "German", "English"))
which gives the following error.
Traceback (most recent call last):
File "C:\Users\femustafa\Desktop\Language app\main.py", line 81, in <module>
print(translate.translate("Hello", "German", "English"))
File "C:\Users\femustafa\Desktop\Language app\.venv\lib\site-packages\translatepy\translators\base.py", line 110, in translate
source_language, translation = self._translate(text, dest_code, source_code)
File "C:\Users\femustafa\Desktop\Language app\.venv\lib\site-packages\translatepy\translators\bing.py", line 156, in _translate response = self.session_manager.send("https://www.bing.com/ttranslatev3", data={'text': text, 'fromLang': source_language, 'to': destination_language})
File "C:\Users\femustafa\Desktop\Language app\.venv\lib\site-packages\translatepy\translators\bing.py", line 135, in send
raise BingTranslateException(status_code)
translatepy.translators.bing.BingTranslateException: 205 | Unknown error. Error code: 205
Am i doing something wrong? . Your help will be appreciated.
The
example
function is not working. First, I use the following codewhich gives the following error.
As
example
function is not implemented for all translators. I just use Bing translatorwhich gives the following error.
Am i doing something wrong? . Your help will be appreciated.