
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
microsoft_translator
Advanced tools
Ruby wrapper for Microsoft Translate HTTP API.
Still a work-in-progress. Currently only supports translating one string of text at a time.
Before translating things from your ruby application you first need to sign up for the Microsoft Translator API in the Windows Azure Datamarket.
Don't worry, they have a free tier! (up to 2 million translated characters/month) Once you sign up for the Translator API you will also need to register your application with the Azure Datamarket.
https://datamarket.azure.com/developer/applications/
Also, you shouldn't stress about what to put for the Redirect URI. For the purposes of this gem you won't be using it so your project's homepage will work just fine. You'll use the Client ID and Client secret to authenticate your requests to the API. Once this is done you'll install it like you would any other gem...
Add this line to your application's Gemfile:
gem 'microsoft_translator'
And then execute:
$ bundle
Or install it yourself as:
$ gem install microsoft_translator
Create a MicrosoftTranslator::Client with your Client ID & secret.
translator = MicrosoftTranslator::Client.new('your_client_id', 'your_client_secret')
To translate pass in the foreign text along with the language codes for the language you are going from/to and the content type. The content type is either "text/plain" or "text/html"
spanish = "hasta luego muchacha"
translator.translate(spanish,"es","en","text/html")
# => "until then girl"
To detect the language simply pass in the foreign text. The language code will be returned.
translator.detect("Quiero un burrito")
# => "es"
That's about it! This is a list of the supported languages by the Microsoft Translate API http://www.microsofttranslator.com/help/?FORM=R5FD and here are all the language codes as a helpful reference. http://www.loc.gov/standards/iso639-2/php/code_list.php
There are still quiet a few other methods available in the API that need to be covered. http://msdn.microsoft.com/en-us/library/ff512419.aspx
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)FAQs
Unknown package
We found that microsoft_translator demonstrated a not healthy version release cadence and project activity because the last version was released 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
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.