google-translator

command module
v0.0.0-...-8835833 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 4, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README


{ "image": "direktiv/google-translator", "desc": "Reads a string and converts it to the targeted language." }

Google Translator

Reads a string and converts it to the targeted language.

Direktiv

An example workflow of reading the string and converting to a target language.

id: read-message
functions:
- id: translate
  image: direktiv/google-translator:v1
states:
- id: read
  type: action
  action:
    function: translate
    input: jq(.)

Input

The input required to run the above workflow properly is the following:

input:
  message: "Hello World!"
  "target-language": "ja"
  serviceAccountKey: jq(.secrets.SERVICE_ACCOUNT_KEY)

Output

Upon successfully translating the string using Google's API. THe following output will appear

{
    "message": "こんにちは世界"
}

Error

In the case that an error is encountered, it will present in the following format:

{
    "errorCode": "com.google-translator.error",
    "errorMsg": "Something Went Wrong"
}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL