This gem scraps GoogleTranslate and returns the translation for the given search phrase.
If multiple translations are available, multiple are returned.
Add this line to your application's Gemfile:
gem 'google_translate_scraper'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install google_translate_scraper
1- require 'google_translate_scraper'
2- response = GoogleTranslateScraper.translate(:source_language => 'en', :target_language => 'sv', :search_text => 'hey')
3- response.translations.first
NOTE: source and target language values must be a string containg the ISO 639-1 two letter code for that language. For a list see here: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request