Arshad Mehmood

Search the blog

    Langur translation chatbot conversation screenshot

    Development

    My first open source repository - Langur translation chat bot

    2 min readDevelopmentbotsnodejsbot-framework+2

    Sometime ago, I made a chatbot from translating one language to another called Langur. Today, I have decided to make it open source, so that people can learn from it and make chat bots easily. It’s my very first open source repository and way of contributing to the open source community. The bot is live and it has some channels linked to it, you can test it in the demo section. It’s really simple and anyone can do. You will find the Language translation chat bot on Github. Here is a little intro about what it does and how to use it.

    Langur chat asking for a source and target language

    Langur is a translation chat bot made with Microsoft Bot Framework with Node.js and a free Google translate Api. You can read more about it on my blog.

    Demo:

    Fb Messenger Message Langur on Messenger

    kik langurtranslator

    Facebook page: fb.me/LangurTranslator

    How it works:

    In the beginning, the bot asks you for your source and target language and then it translates whatever you type into it.

    To run:

    Install dependencies:

    npm install

    Insert your appId and appPassword After installing the dependcies, create a bot on the Microsoft Bot framework. Get the appId and the appPassword. Replace these values here:

    
    var keys = require('./keys.js'); //Remove it, used only to import appId and appPassword
    
    // Create chat connector for communicating with the Bot Framework Service
    var connector = new builder.ChatConnector({
        appId: keys.appId, //Replace with App Id from your Microsoft bot
        appPassword: keys.appPassword //Replace with App Password from your Microsoft bot
    });
    

    Or create a file named: keys.js and export these values.

    Run the app

    node app.js
    Microsoft Bot Emulator connection settings

    Install Microsoft Bot Emulator

    Download and Install Microsoft Bot Framework Emulator to run on localhost.

    Enter your appId and appPassword and click connect,

    Langur chatbot running in the Bot Emulator

    Afterwards, you can interact with the bot like so:

    Langur translating a chat message

    License

    Langur - Language translation chat bot is released under the GNU General Public License v3.0. Please refer to the LICENSE file for detailed information.

    Copyright: Arshad Mehmood

    Discussion

    Comments are not enabled on this build. Production uses Giscus (GitHub Discussions) when the repository secrets are set.