Debug Tips
What happened?
Description
The yandex translator function only supports 33 languages and is missing many languages including Arabic (ar), Japanese (ja), Thai (th), Hindi (hi), etc.
Error Message
TranslatorError: Unsupported to_language[ar] in ['az', 'be', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'fi', 'fr', 'hr', 'hu', 'hy', 'it', 'lt', 'lv', 'mk', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sq', 'sr', 'sv', 'tr', 'uk', 'zh'].
Steps to Reproduce
import translators as ts
result = ts.translate_text("Hello", translator='yandex', to_language='ar')
# Raises TranslatorError
Root Cause
In
server.py
(line 5969) and
server_async.py
(line 6192), the code uses
YandexV2()
which calls a limited browser API (browser.translate.yandex.net with srv=browser_video_translation) that only returns 33 translation directions.
YandexV1
parses https://translate.yandex.com directly and supports 115 languages including Arabic.
Suggested Fix
Change
YandexV2()
to
YandexV1()
:
python
self._yandex = YandexV1() # Supports 115 languages including Arabic
### APP Version
0.0.1 (default)
### Python Version
3.13 (default)
### Runtime Environment
Windows
### Country/Region
Arabic
### Relevant log output
```sh
Screenshots
Code of Conduct
Debug Tips
What happened?
Description
The yandex translator function only supports 33 languages and is missing many languages including Arabic (ar), Japanese (
ja), Thai (th), Hindi (hi), etc.Error Message
TranslatorError: Unsupported to_language[ar] in ['az', 'be', 'bg', 'ca', 'cs', 'da', 'de', 'el', 'en', 'es', 'et', 'fi', 'fr', 'hr', 'hu', 'hy', 'it', 'lt', 'lv', 'mk', 'nl', 'no', 'pl', 'pt', 'ro', 'ru', 'sk', 'sl', 'sq', 'sr', 'sv', 'tr', 'uk', 'zh'].
Steps to Reproduce
Screenshots
Code of Conduct