Yandex Translator

  • Description

      Yandex Translator

      The Yandex Translator component allows you to translate words and prayers between different languages.

      • You need Internet access, since you will request translations to the service Yandex Translate.
      • You must specify the origin and destination language in the form source-target using two letter language codes. For example: "en-es" will be translated from English to Spanish, while "es-ru" will be will translate from Spanish to Russian.
      • If you omit the origin language, the service will try to detect the language of origin. So if it provides only "is" it will try to detect the language of origin and translate it into Spanish.

      This component is powered by the Yandex translation service. See API Yandex for more information, including the list of available languages ​​and the meanings of the language codes and state.
      Note: The translation is done asynchronously in the background. When complete the translation, the "Got Translation" event is triggered.

  • Events

    • Got translation
    • Event that is executed when the Yandex.Translate service returns the translated text. This event also provides a response code for error handling. If the answer code is not 200, then something went wrong with the call and the translation it wont be available.
  • Procedures

    • Request translation
    • This method will request a translation to Yandex by providing a language of destination to translate to (for example, 'es' for Spanish, 'en' for English or 'ru' for Russian) and a word or phrase to translate. Once the external service translates the text, the 'Got Translation' event will be executed.
      Note: Yandex.Translate will try to detect the Source language. You can also specify before the translation of the language. Is say, es-ru will specify the translation from Spanish to Russian.
  • Example

    • Translating spoken text into English
    • For this example we need several multimedia components.
      • Text to speech.
      • Speech recognizer
      • Yandex translator.

    • These first two blocks, will capture our voice (Speech recognizer) and they will translate it (Yandex Translator) into English. With the obtained result we are going to put two examples of use.

    • Here we use the received translation and put it in a label, so the user can read the translation.

    • In this case, we use the Text to Speech component to use the text originated in the translation and reproduces it.