If one likes to speed up the process of translating all nodes in a Flow for different locales, the
translate command could be used.
How it works
For this tutorial, the Main flow of the agent will be translated from English into German. Therefore, one needs to navigate to the virtual agent's folder in the command line -- the directory where the config.json file is located. The structure should look similar to this:
├── agent │ ├── flows │ ├── Main │ │ ├── config.json │ │ └── en-US │ │ ├── chart.json │ │ └── intents.json
│ │ └── de-DE
│ │ ├── chart.json
│ │ └── intents.json │ └── locales.json
In this example, the agent already contains the necessary locales:
Now the following command needs to be executed in order to translate the entire Flow into German:
cognigy translate flow 'Main' -tr 'deepl' -k '<deepl-api-key>' -l 'de-DE' -tl 'de' -tn
This will use the DeepL translator* with a related API Key for adding localization to all nodes in the German version of the Flow, copying the English text and, finally, translate it.
* One can choose between Microsoft, Google or Deepl Translate.