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

ca_translate doesn't exist #53

Open
SoyMaster opened this issue Nov 3, 2019 · 1 comment
Open

ca_translate doesn't exist #53

SoyMaster opened this issue Nov 3, 2019 · 1 comment

Comments

@SoyMaster
Copy link

SoyMaster commented Nov 3, 2019

Is your README.txt up to date ?

from python_translators.translators.google_translator import GoogleTranslator
gt = GoogleTranslator(source_language='nl', target_language='en', key='AIzaSyA4MtvBIINuBpp-NwgNnsNuzWWjTxH35So')
gt.ca_translate('patate')

Which results in the error:

AttributeError                            Traceback (most recent call last)
<ipython-input-139-8fd1b838fc42> in <module>
      1 gt = GoogleTranslator(source_language='nl', target_language='en', key='AIzaSyA4MtvBIINuBpp-NwgNnsNuzWWjTxH35So')
----> 2 gt.ca_translate('patate')

AttributeError: 'GoogleTranslator' object has no attribute 'ca_translate'

I have also tried to do as in your tests, using the Queries Objects passed in the Google_translate_factory Objects. Why isn't it working like that in in your package? Your test doesn't seem to test the function you displayed in the README.

@dejagersh
Copy link
Collaborator

Hi @SoyMaster thank you for your message.

It seems like the README.md is outdated.

You should use the translate() method and pass a TranslationQuery object.

def translate(self, query: TranslationQuery) -> TranslationResponse

I would advise looking at the source code :) I’m currently unable to fix the README

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

2 participants