0.0
No release in over a year
use google translate service without struggles
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2.22
~> 11.1.3
~> 10.0
~> 3.2

Runtime

 Project Readme

📝 Ggtranslate

Inspired by this py-googletrans topic.

NOTE: Ggtranslate is not official supported by Google and not recommended to use in production.

Ggtranslate is a hacked way to use google translate without hassles. You don't need to have API_KEY to start.

📝 Installation

Add this line to your application's Gemfile:

gem 'ggtranslate'

Or install it yourself as:

$ gem install ggtranslate

📝 Usage

Quick Example

Start with translate 1 simple sentence from English to Vietnamese

require 'ggtranslate'
result = Ggtranslate.translate("hello", "en", "vi")
result.translated_text
# => "xin chào"

You can query in bulk to make less api calls.

sentences = [
    %q{xin chào mọi người},
    %q{chào buổi sáng},
    %q{chào buổi tối},
]

result = Ggtranslate.translate(sentences, "auto", "en")
result.translated_text

# => ["hello everyone", "good morning", "good evening"]

you can use auto to let Google Translate auto detect source / dest language

To get all supported languages

Ggtranslate::LANGUAGES

📝 License

The gem is available as open source under the terms of the MIT License.