# eric6.Plugins.UiExtensionPlugins.Translator.TranslatorEngines.GoogleV1Engine

Module implementing the Google V1 translation engine.

### Global Attributes

None

### Classes

GoogleV1Engine | Class implementing the translation engine for the old Google translation service.

### Functions

None

## GoogleV1Engine

Class implementing the translation engine for the old Google translation service.

### Derived from

TranslationEngine

### Class Attributes

TextToSpeechLimit
TextToSpeechUrl
TranslatorUrl

### Class Methods

None

### Methods

GoogleV1Engine | Constructor
engineName | Public method to return the name of the engine.
getTextToSpeechData | Public method to pronounce the given text.
getTranslation | Public method to translate the given text.
hasTTS | Public method indicating the Text-to-Speech capability.
supportedLanguages | Public method to get the supported languages.

### Static Methods

None

#### GoogleV1Engine (Constructor)

GoogleV1Engine(plugin, parent=None)

Constructor

plugin
  reference to the plugin object (TranslatorPlugin)
parent
  reference to the parent object (QObject)

#### GoogleV1Engine.engineName

engineName()

Public method to return the name of the engine.

Returns:
  engine name (string)

#### GoogleV1Engine.getTextToSpeechData

getTextToSpeechData(requestObject, text, language)

Public method to pronounce the given text.

requestObject
  reference to the request object (TranslatorRequest)
text
  text to be pronounced (string)
language
  language code of the text (string)

Returns:
  tuple with pronounce data (QByteArray) or error string (string) and success flag (boolean)

#### GoogleV1Engine.getTranslation

getTranslation(requestObject, text, originalLanguage, translationLanguage)

Public method to translate the given text.

requestObject
  reference to the request object (TranslatorRequest)
text
  text to be translated (string)
originalLanguage
  language code of the original (string)
translationLanguage
  language code of the translation (string)

Returns:
  tuple of translated text (string) and flag indicating success (boolean)

#### GoogleV1Engine.hasTTS

hasTTS()

Public method indicating the Text-to-Speech capability.

Returns:
  flag indicating the Text-to-Speech capability (boolean)

#### GoogleV1Engine.supportedLanguages

supportedLanguages()

Public method to get the supported languages.

Returns:
  list of supported language codes (list of string)

Up