For more information, refer to GitHub.
What does this plugin do?
This plugin uses Google Cloud Translation API to translate the user input text and detect its language.
Install the plugin
To install this plugin, you only need to execute the following command:
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:
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
Important: all languages are specified using its ISO 639-1 code.
Once the plugin has translated the input text and detected the language, this information will be available in the input object.