Skip to content

[Bug]: Yandex translator missing Arabic and many languages (YandexV2 limitation) #183

@zinzied

Description

@zinzied

Debug Tips

  • I'm sure I've read this project's Issues of README.

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

![DESCRIPTION](LINK.png)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions