Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specific translation does not work #419

Closed
3 of 6 tasks
kmilodenisglez opened this issue Sep 25, 2024 · 4 comments
Closed
3 of 6 tasks

Specific translation does not work #419

kmilodenisglez opened this issue Sep 25, 2024 · 4 comments

Comments

@kmilodenisglez
Copy link

Googletrans version:

  • 4.0.0rc1
  • 3.1.0a0
  • 3.0.0
  • 2.x

I'm submitting a ...

  • bug report
  • feature request

Current behavior:

When I try to translate the text "Set Commission In Percentage For This Seller" from English to Spanish, it gives me the error: AttributeError: 'NoneType' object has no attribute 'group'

Related code:

from googletrans import Translator

translator = Translator()
translation = translator.translate("Set Commission In Percentage For This Seller", dest="es")

Other information:

@jo47011
Copy link

jo47011 commented Oct 13, 2024

Same for me:

translator.translate("Printer", dest="de")

raises an

TypeError("'NoneType' object is not iterable")

Strange enough, this works:

translator.translate("PrinterFoobar", dest="de")

@rahulb99
Copy link

Can try this for now #398 (comment). I don't think the maintainer is that actively supporting this project now.

@Bhushankadam17
Copy link

its because some words in Spanish has two translations one feminine and one masculine so google returns both translation so it becomes array, i added condition in the parsing login where if there is array then return its first element, it works for me.

@ssut
Copy link
Owner

ssut commented Jan 3, 2025

I have officially released version 4.0.0 of py-googletrans. I will now close issues related to earlier versions. If you are still experiencing the same issue in the latest release, please open a new issue. I apologize for the delay in addressing these issues and hope the latest release resolves them. Thank you for your understanding.

@ssut ssut closed this as completed Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants