Getting Started
Basic Concepts
Tutorials
Advanced Concepts
How-to Guides
Building integration flows
Data transformation
Integration patterns
Developing Components
Tenant Management
Components
CRM Components
ERP Components
E-Commerce Components
Basic Components
Utility Components
References
Sailor
Component Descriptor
Covered in this article
Related articles
Contracts and Workspaces Understanding credentials Data Sample Overview Creating your first integration flow Getting Started What is an integration component? What is an integration flow? What is a tenant? Take a tour of the product Creating a webhook flow Building a component in Java Building a component in Node.js Content-Based Routing Deploying a component How-to Guides Managing flow history Managing OAuth Clients Managing user roles in a tenant Managing Workspaces Mapping data Building real-time flows Sending data to a list of recipients REST API component Managing your SSH keys Managing your Teams/Components Allmysms component Amazon MWS component AMQP component AppDirect Component AWS Lambda component AWS SNS component Bazaarvoice component ChannelAdvisor component Code component Configuration component CSV component Docusign component Dun-and-bradstreet component Ebay component Edifact-parser component Email component Exact Online component Filter component Google PubSub component Google-shopping component Goto-webinar component Google Spreadsheets component Components JDBC Component JDBC Component JDBC Component Jsonata component Key-value-component component Ldap component Lightspeed-ecom component Lightspeed-retail component Lionbridge-translation component Magento1 component Magento2 component Mailchimp component Mandrillapp component Mapper component Microsoft Dynamics CRM component MsSQL component NetSuite component ODATA component Outlook component Petstore-nodejs component Pipedrive component Postgresql component Quickbooks-component component Request-reply component Rest API component Router component Salesforce-cpq component Salesfoce Component Sdl-translate component Sftp component Shopify-admin component Shopware component Simple-trigger component Smarty-streets component Soap component Splitter component Stripe component Sugar-crm component Timer component Twitter component Webhook component Xml component Component Descriptor Structure References Sailor compatibility matrix View Classes

Google-translate component

Description

Google translate component for the elastic.io platform.

Credentials

In oprder to authenticate, you need to receive apiKey from your Google cloud platform account

Actions information

When specifying the language in a Configure input section, use two or three letter codes for that. For example,

english -> en
russian -> ru
franch -> fr
-----
english -> eng
russian -> rus
franch -> fra

Such codes can be foud in a result of Retrieve supported languages action execution

Translate phrase

sourceLang field is optional. Google will autodetect the source locale if not specified.

in/out metadata can be found at /lib/schemas/translatePhrase.{in/out}.json

Detect language

in/out metadata can be found at /lib/schemas/detectLanguage.{in/out}.json

Retrieve supported languages

out metadata can be found at /lib/schemas/retrieveSupportedLanguages.out.json

Translate object properties

in/out metadata can be found at /lib/schemas/translateObjectProperties.{in/out}.json

usage example

input message:

{
    "sourceObject": {
        "hello": "hello world",
        "capital": "London is the capital of Great Britain"
    },
    "sourceLang": "en",
    "targetLang": "de"
}

output message:

{
    "hello": "Hallo Welt",
    "capital": "London ist die Hauptstadt von Großbritannien"
}

Translate array of objects

in/out metadata can be found at /lib/schemas/translateObjectProperties.{in/out}.json

usage example

input message:

{
	"sourceArray": [
		{
            "hello": "hello world",
            "capital": "London is the capital of Great Britain"
		},
		{
			"color": "red",
			"mood": "great mood"
		}
	],
	"sourceLang": "en",
	"targetLang": "de"
}

output message:

{
    "translatedArray": [
    	{
    		"capital": "London ist die Hauptstadt von Großbritannien",
    		"hello": "Hallo Welt"
    	},
    	{
    		"mood": "großartige Stimmung",
    		"color": "rot"
    	}
    ]
}

You need to create new or use existing GCP project and enable Google Cloud Translation API

How to create new project: https://cloud.google.com/resource-manager/docs/creating-managing-projects