- Print
- PDF
A node that translates any input event with a Text
attribute.
Parameters:
name | description | default |
---|---|---|
IgnoreSslErrors | Ignore any SSL certificate errors for the Http calls | false |
SourceLanguage | Language of the source text. | tr-TR |
TargetLanguage | Language of the target text | en-US |
Key | Api key for the translate service | empty |
Inputs
Audio:
none
Events:
name | description | known nodes that generate this event |
---|---|---|
Any event that has Data.Text | Any Text based event such as: SR Milestone, SR Partial etc. | SR Http, SR Websocket, Translate etc. |
Language Change | Customized Language Change event that specifies if the Target, or Source language needs to be changed. | Language Identifier, Text Language Identifier |
The language change event that exits Language Identifier or Text Language Identifier can be customized to specify Target or Source language change by utilizing custom nodes. Premade scripts can be acquired from the customs page.
Outputs
Audio:
none
Events:
name | description |
---|---|
Translation | Contains the translated text in Data.Text field. |
Remarks :
Requirements
The node needs an Google Translate Cloud Api key to perform. To learn more about setting up an API Key, you can refer to the Google Cloud Translation page. Keep in mind that we are utilizing the REST endpoint, and make sure you keep your API Key safe.
Project Structure
The node expects events that have the Text
field. Which means the node can be used with any and all SR nodes.
A minimum viable project that utilizes Translate node can be built as such:
With this project, one can use both Speech recognition and have the text translated to any desired language simultaneously.
Taking this a step further, we can construct a project such as:
Which recognizes a speech, translates the text into another language, and uses TTS to create simultaneous audio outputs.
Finally, here's a project that manipulates the Translation
event so that it is punctuated, filtered, normalized
before returning the output.
Also, keep in mind that the SR node needs to fit the Source Language
, and Punctuation, Profanity Filter, Normalizer nodes need to fit the Target Language
.
Detailed Workflow
Utilizes Http calls to Google Translate Api with the provided Api key
. Raises a Translation
event for every response.
Supported flow types: Stream, Batch