Bot to translate the text from many to many other languages, thanks to Cisco and google :-)
Integrated with:
- Cisco Spark as business messaging for the supported chat platform
- Google Translate API
- auto translation mode
- user settings
The main idea is so to provide a text translator tool by chat for:
- 1:1 chat room
- group chat
Features:
- 107 languages
- command to configure auto-translation
- permanent db storage for the user settings (redis)
on
: active the auto translationoff
: deactive the auto translationconfig
: provide the current configconfig [lang in] [lang out]
: configure the auto translationstate
: provide the current state
`[lang in] [lang out] [*/phrase]
- en fr I like it!
- fr de j'ai un rendez-vous demain
[\*/phrase]
- I like it!
107, in summary
- en - English
- es - Spanish
- fr - French
- de - German
- ru - Russian
- it - Italian
- ja - Japanese
- ar - Arabic
- zh-CN - Chinese (Simplified)
- zh-TW - Chinese (Traditional)
Full list: https://cloud.google.com/translate/docs/languages
Settings is done to send all chat messages formatted properly to a log stash system.
Thanks to active it in the configuration file
config.js
> config.bigdata.enable = true;
- Clone localy
git clone https://github.com/guillain/MultiLang.git
- Go into the folder
cd ServiceDeskBot
- Put your CSV file (named km.csv) in the conf folder (key->txt structure)
cp [your CSV file] app/conf/km.csv
- Config your app with your spark bot
vi app/config.js
- Install dependencies
npm install
- Run the application, two configuration availables
- 1/ For the dev, node is used
./run manual
- 2/ For the prod, pm2 is used (install also this dependency)
./run [start|stop|restart|show|status|log]
- Add the bot in 1:1 or in chat group room
Provided also for Docker env. with the Dockerfile for the standalone builder
To build the image:
docker build -t bot/multilang .
To run the image:
docker run -d -p 8083:3333 bot/multilang
To go in the container:
docker exec -it bot/multilang /bin/bash
To check the logs
docker logs bot/multilang --details -f
- flint Redis storage (issue: flint-bot/flint#22). Thanks to use the old redis.js file.