
Security News
libxml2 Maintainer Ends Embargoed Vulnerability Reports, Citing Unsustainable Burden
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
google-translate-free
Advanced tools
This repository is a robust translation service designed to help you with a variety of language-based features including direct translations, alternate translations, definitions, examples, transliterations, spelling suggestions, language detection, and highly relevant keyword suggestions.
Let's read the documents before using it.
Add this line to your application's Gemfile:
gem 'google-translate-free', '~> 1.0.1'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install google-translate-free
To translate
Translate.translate('summer', :vi, :en)
# => "mùa hè"
Without third params, Google Translate will auto-detect your source language.
Translate.translate('summer', :vi)
# => "mùa hè"
For alternate Translations
Translate.alternate_translations('summer', :vi, :en)
# =>
#[
# "mùa hè",
# "mùa hạ",
# "hè"
#]
Without third params, Google Translate will auto-detect your source language.
Translate.alternate_translations('summer', :vi)
# =>
#[
# "mùa hè",
# "mùa hạ",
# "hè"
#]
For definitions
Translate.definitions('summer')
# =>
#[
# {
# :noun=>[
# ["The warmest season of the year, in the northern hemisphere from june to august and in the southern hemisphere from december to february.", "<b>summer</b> vacation.", nil],
# ["A horizontal bearing beam, especially one supporting joists or rafters.", nil, nil]
# ]
# },
# {
# :verb=>[
# ["Spend the summer in a particular place.", nil, nil]
# ]
# }
#]
For examples
Translate.examples('summer')
# =>
#[
# "The plant flowers in late <b>summer</b>.",
# "The golden <b>summer</b> of her life.",
# "A long hot <b>summer</b>.",
# "<b>summer</b> vacation."
#]
For transliteration
Translate.transliteration('summer')
# => "ˈsəmər"
For spelling suggestions
Translate.suggest('summmer')
# => "summer"
For language detection
Translate.detection('summer')
# => ["en", 0.93254006]
For keyword suggestions
Translate.see_more('summers')
# => "summer"
I welcome contributions to this project.
git checkout -b your-feature
).git commit -am 'Add some feature'
).git push origin your-feature
).The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that google-translate-free demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Libxml2’s solo maintainer drops embargoed security fixes, highlighting the burden on unpaid volunteers who keep critical open source software secure.
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.