Socket
Book a DemoInstallSign in
Socket

@botonic/plugin-google-translation

Package Overview
Dependencies
Maintainers
10
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@botonic/plugin-google-translation

## What does this plugin do? This plugin uses [Google Cloud Translation API](https://cloud.google.com/translate) to translate the user input text and detect its language.

0.38.0
latest
npmnpm
Version published
Maintainers
10
Created
Source

Botonic Plugin Google Translation

What does this plugin do?

This plugin uses Google Cloud Translation API to translate the user input text and detect its language.

Setup

Install the plugin

To install this plugin, you only need to execute the following command:

npm i @botonic/plugin-google-translation 

Enable Cloud Translation API

Before using this plugin, you need a project that has the Cloud Translation API enabled and its credentials. See Cloud Translation Set Up Guide.

Add the plugin

You need to add the following configuration to your bot's plugins:

export const plugins = [
    {
        id: 'google-translation',
        resolve: require('@botonic/plugin-google-translation'),
        options: {
            credentials: {
                privateKeyId: '',
                privateKey: '',
                projectId: '',
                clientEmail: '',
            },
            translateTo: ['ca', 'it', 'ro'],
            whitelist: ['en', 'es'],
        },
    },
]

Note: Credentials definition is case-sensitive: make sure you correctly define them.

This plugin has two parameters:

  • translateTo: languages we want to translate the input text to.
  • whitelist: optional parameter that defines the allowed languages for language detection. If the detected language is not included in the whitelist, the session.__locale is used.

Important: all languages are specified using its ISO 639-1 code.

Use

Once the plugin has translated the input text and detected the language, this information will be available in the input object.

Keywords

bot-framework

FAQs

Package last updated on 20 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.