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

Translation to English #53

Open
Wallvon opened this issue Aug 1, 2019 · 4 comments
Open

Translation to English #53

Wallvon opened this issue Aug 1, 2019 · 4 comments

Comments

@Wallvon
Copy link

Wallvon commented Aug 1, 2019

When I try to translate something to English it always responds with the original text and not the translated one.

Example:

In [1]: from translate import Translator
In [2]: translator= Translator(to_lang="en")
In [3]: translation = translator.translate("Waar bevindt zich het dichtbijzijnste treinstation?")
Out [3]: Waar bevindt zich het dichtbijzijnste treinstation?

@pichatelli-zz
Copy link

Ran into the same problem and by reading the code I realized that the default from_lang is english (check here), which will not trigger a translation. Just change the parameter while instantiating your Translator will do the trick.

>>> translator= Translator(to_lang="en", from_lang='autodetect')
>>> translator.translate("Waar bevindt zich het dichtbijzijnste treinstation?")
'Where is the nearest train station?'

@mennatallah644
Copy link

@pichatelli
when i tried to run your lines it gives me this msg
rrr

@liliana3186
Copy link

Ran into the same problem and by reading the code I realized that the default from_lang is english (check here), which will not trigger a translation. Just change the parameter while instantiating your Translator will do the trick.

>>> translator= Translator(to_lang="en", from_lang='autodetect')
>>> translator.translate("Waar bevindt zich het dichtbijzijnste treinstation?")
'Where is the nearest train station?'

I have same problem and I get "'' IS AN INVALID SOURCE LANGUAGE . EXAMPLE: LANGPAIR=EN|IT USING 2 LETTER ISO OR RFC3066 LIKE ZH-CN. ALMOST ALL LANGUAGES SUPPORTED BUT SOME MAY HAVE NO CONTENT"

@arsenikov
Copy link

Exactly

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