google-translate: Google Translate API bindings

[ bsd3, library, web ] [ Propose Tags ]

Google Translate Library


[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.1.1.1, 0.1.1.2, 0.2, 0.3, 0.4, 0.4.1, 0.5
Dependencies aeson, base (>=4.7 && <5), bytestring (>=0.10 && <0.11), either (>=4.4 && <4.5), servant (>=0.4 && <0.5), servant-client (>=0.4 && <0.5), text (>=1.2 && <1.3) [details]
License BSD-3-Clause
Copyright David Johnson (c) 2016
Author David Johnson
Maintainer djohnson.m@gmail.com
Category Web
Source repo head: git clone https://github.com/dmjio/google-translate
Uploaded by DavidJohnson at 2015-09-25T03:15:14Z
Distributions
Reverse Dependencies 1 direct, 0 indirect [details]
Downloads 5975 total (29 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-09-25 [all 1 reports]

Readme for google-translate-0.1.1.2

[back to package description]

google-translate

Hackage Hackage Dependencies Haskell Programming Language BSD3 License Build Status

High-level, up-to-date bindings to the Google Translate API.

import Control.Monad
import qualified Data.Text.IO as T
import Data.Maybe
import Web.Google.Translate                                                                                             
                                                                                                                                                                                  
main :: IO ()
main = do
  Right TranslationResponse { translations = xs } <-
    translate (Key "<API-Key>") (Just srcLang) trgLang (Body "Hello")
  forM_ xs $ \Translation { translatedText = TranslatedText txt } ->
    T.putStrLn txt
  where
    srcLang = Source English
    trgLang = Target Russian
    
-- >>> Здравствуйте