Skip to content

Commit

Permalink
Updated README for detect method
Browse files Browse the repository at this point in the history
  • Loading branch information
LupineDev committed Feb 1, 2013
1 parent e089793 commit 6773680
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ 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 allong with the language codes for
### Translation

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"

Expand All @@ -55,6 +57,15 @@ translator.translate(spanish,"es","en","text/html")
# => "until then girl"
```

### Language Detection

To detect the language simply pass in the foreign text. The language
code will be returned.

```ruby
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.
Expand Down
2 changes: 1 addition & 1 deletion lib/microsoft_translator/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module MicrosoftTranslator
VERSION = "0.1.1"
VERSION = "0.2.0"
end

0 comments on commit 6773680

Please sign in to comment.