Automatic email translation is a project inspired by the challenges that Minister of Imigration & Citizenship is facing. It aims to help all new immigrants with the initial language barrier.
The main idea is to setup an automatic translation of the incoming email correspondance to any preferred language.
Hopefuly, the following tool can be supplied to all enrolled in Cours de français à temps complet as a part of the tool package.
-
Gmail account which serves as a source of information for the tool.
-
Avialable server to host Jenkins for automation purposes.
-
Obtain Yandex Tanslation API credentials to get access to translation service. Do not rename or change location of the obtained
translation_token.json. -
Setup configuration file:
config.json
| Property | Description |
|---|---|
| translationRecipient | Gmail account of the translated message recipient |
| subject | Desired subject for the emails recieved from the tool |
| translationLanguage | Preferred language for translation |
{
translationRecipient: "recipient_email@gmail.com",
subject: "Translation Bot",
translationLanguage: "en-ru"
}Refer to the list of supported languages at Supported languages.
- Execute
makecommand.
makeThe first time you would need to grant access to your gmail account.
Do not rename or change location of the obtained token.json and credentials.json.
Gmail authentication scope is set to the lowest sensitivity, targeting only Primary Inbox unread emails.
Authentication will no longer be necessary after the initial setup is finished.
-
At this point the tool can be utilized locally for development or on-demand translation. For the automatization, proceed with the following steps:
-
Install Docker on your machine.
-
Refer to the following Jenkins setup with Docker for your desired OS.
-
Add Poll Mailbox Trigger Plugin that would trigger out tool on every incoming inbox message.
-
Add Go plugin for the code execution.
-
Add Authentication Tokens API Plugin to supply all the tokens received during authorization process.
-
Follow the Freestyle job guide and point your Jenkins job towards your repository. At this point everything should be up and running, since Jenkinsfile is already present.
-