Skip to content
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

Specific translation does not work #419

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

Specific translation does not work #419

kmilodenisglez opened this issue Sep 25, 2024 · 3 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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants