Closed
Description
The docs for Translator().translate indicate the following behavior:
from_lang (str) – Language to translate from. If None, will attempt to detect the language.
The translation fails if both 1) the text is not in English and 2) from_lang is not explicitly set to None.
>>>from textblob.translate import Translator
>>>t = Translator()
>>>t.translate('hello', to_lang='fr')
u'Bonjour' # correct
>>>t.translate('hola', from_lang=None, to_lang='fr')
u'Bonjour' # correct
>>>t.translate('hola', to_lang='fr')
u'Hola' # incorrect
Metadata
Metadata
Assignees
Labels
No labels