Recents
External Object: Google TranslatorUnofficial Content

Important: This implementation apply to Api V1, for that reason is deprecated. To api v2, refer to Google Developer or SAC 35454 or Google Translator XPZ ApiV2

Introduction

Simple external object that allow you to translate strings an easy way.

This example XPZ show how use it.

The you can download source code from here GoogleTranslator.zip

OBS: currently only available for. NET. Future version will add support for java.

Class Descriptions

Translator consists of three external objects.

GapiTranslator: main class responsible for performing translations using Google services and Gapi.dll (for. NET).

TranslationResult: class that encapsulates the result of the translation. It has three parameters:

responseData: translated string.

responseStatus: code indicating whether the translation is completed successfully. A code distinct of 200 indicates an error.

responseDetails: string that describes the final state of the translation.

Language: this class defines the possible languages that currently support translation services of Google and provides some methods to facilitate translation.

Note that Google translation service can change its version, this leads to change the URL. For this reason, there are overloads of translate method to get a direction where to look for the service. By default it uses http://ajax.googleapis.com/ajax/services/language/translate?v=1.0&<str_to_translate>&langpair=<source_language_code>|<target_language_code>.

The next version of the class Language will allow to change languages codes and names defined by default and add new ones, keeping the translator up to date with Google services.

See At

For more information please refer to the http://marketplace.genexus.com.