-
-
Notifications
You must be signed in to change notification settings - Fork 184
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Exception when translate a string with digit #216
Comments
Hi @vgdh, A priori, the issue comes from this module. It raises an exception if the text is not a string or the string is a digit. See: deep-translator/deep_translator/validate.py Lines 12 to 28 in 4328b37
I don't know if it is on purpose or a bug… To fix this specific problem, you could change the condition on line 23 from Or catch the exception before it occurs and automatically return the digit… well, it is probably not the best solution for languages that do not use Arabic figures. |
I think @vgdh And yes, I also encounter the exact exception. |
|
@vgdh I think you have a good point there. When I created the module, I thought that it wouldn't make sense to pass a digit as input, but yes I will update this one. At least for the google translator. Thanks for the input |
Description
I pass a string that contain only one number and got this exception.
What I Did
The text was updated successfully, but these errors were encountered: