'Translate the blob to another language.
Uses the Google Translate API. Returns a new TextBlob.
Requires an internet connection.
Usage:
>>> b = TextBlob("Simple is better than complex")
>>> b.translate(to="es")
TextBlob(\'Lo simple es mejor que complejo\')
Language code reference:
https://developers.google.com/translate/v2/using_rest#language-params
.. versionadded:: 0.5.0.
:param str from_lang: Language to translate from. If ``None``, will attempt
to detect the language.
:param str to: Language to translate to.
:rtype: :class:`BaseBlob <BaseBlob>`'

def translate(self, from_lang=u'auto', to=u'en'):

    return self.__class__(self.translator.translate(self.raw, from_lang=from_lang, to_lang=to))
