Skip to content

translation api(Google / Microsoft Bing) client written in ruby

License

Notifications You must be signed in to change notification settings

enigmo/translator_proxy

Repository files navigation

Circle CI Code Climate

TranslatorProxy

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'translator_proxy'

And then execute:

$ bundle

Or install it yourself as:

$ gem install translator_proxy

Usage

Translate on Command-line

require 'translator_proxy'

# get subscription key from microsoft
provider_info = {
    subscription_key: '<subscription_key>',
  }

# create translate provider (only Bing now)
TranslatorProxy.provider = ::TranslatorProxy::BingProvider.new(provider_info)

# translate languages
options = { from: 'ja', to: 'en' }

# Translate a string text
text = 'こんにちは'  # Japanese.
TranslatorProxy.translate(text, options)  # => "Hello"

# Translate string array
texts = ['おはよう', 'こんにちは']  # Japanese.
TranslatorProxy.translate_bulk(texts, options)  # => ['Good morning', 'Hello']

Translate on Server

TODO: Write usage instructions from server here

Contributing

  1. Fork it ( http://github.com//translator_proxy/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

About

translation api(Google / Microsoft Bing) client written in ruby

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages