No commit activity in last 3 years
No release in over 3 years
Language translation plugin that uses Microsoft's Translator API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 3.0.0

Runtime

>= 4.2
 Project Readme

lita-translation

Language translation plugin that uses Microsoft's Translator API.

Installation

Add lita-translation to your Lita instance's Gemfile:

gem "lita-translation"

Configuration

This plugin requires you to obtain a client id and secret for Microsoft's Translation API. Register an account at the Microsoft Azure Marketplace, and then register an application that uses the translation API service.

Required attributes

  • client_id (String) - A human readable identifier for your client that you provide on registration.
  • client_secret (String) - A key generated by Microsoft for your client.

Example

Lita.configure do |config|
  config.handlers.translation.client_id = "my-translation-id"
  config.handlers.translation.client_secret = "some key"
end

Usage

An OAuth token is automatically requested by the plugin whenever a fresh one is unavailable.

Microsoft uses ISO-639 codes to identify languages. Klingon is available.

  • languages - List language codes supported by Microsoft's Translator API
  • determine '[text]' - Determine language of the given text
  • translate '[text]' to [code] (from [code]) - Translate the given text from one language to another
  • translate me to [code] (from [code]) - Begin auto-translating all user's speech to the given language
  • stop translating me - End any auto-translation

Source language is optional during translation. Microsoft will attempt to detect the source language if none is supplied.

License

MIT