UlionTse / translators

🌏🌍🌎Translators🌎🌍🌏 is a library that aims to bring free, multiple, enjoyable translations to individuals and students in Python. Translators是一个旨在用Python为个人和学生带来免费、多样、愉快翻译的库。
https://pypi.org/project/translators/
GNU General Public License v3.0
1.66k stars 193 forks source link

TranslatorError: [Bug]: #102

Closed yonglee7015 closed 1 year ago

yonglee7015 commented 1 year ago

Debug Tips

What happened?

TranslatorError: it seems cos of length of text limitation. df['Name_translator'] = df['Name'].apply(lambda x: ts.translate_text(x, translator='google',from_language ='en',to_language='zh')) When I want to translator a column en to zh. it raise this error.

APP Version

0.0.1(example)

Python Version

3.9 (Default)

Runtime Environment

Linux CentOS (Default)

Country/Region

China

Relevant log output

[/usr/local/lib/python3.8/dist-packages/translators/server.py](https://localhost:8080/#) in check_query_text(query_text, if_ignore_empty_query, if_ignore_limit_of_length, limit_of_length)
    192 
    193             if not isinstance(query_text, str):
--> 194                 raise TranslatorError
    195 
    196             query_text = query_text.strip()

TranslatorError:

Screenshots

![DESCRIPTION](LINK.png)

Code of Conduct

UlionTse commented 1 year ago

@yonglee7015 Attention input type