def detect_language(text):
 translate_client = translate.Client()
 result = translate_client.detect_language(text)
 print 'Text: {}'.format(text)
 print 'Confidence: {}'.format(result['confidence'])
 print 'Language: {}'.format(result['language'])

def detect_language ( text ) : translate_client = translate . Client ( ) result = translate_client . detect_language ( text ) print 'Text: {}' . format ( text ) print 'Confidence: {}' . format ( result [ 'confidence' ] ) print 'Language: {}' . format ( result [ 'language' ] )
detects the texts language .