The google-translate package

[ Tags: bsd3, library, web ] [ Propose Tags ]

Google Translate Library


[Skip to Readme]

Properties

Versions 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
Dependencies aeson, base (>=4.7 && <5), bytestring (==0.10.*), http-api-data (>=0.2 && <0.4), http-client (>=0.4 && <0.6), servant (>=0.7 && <0.12), servant-client (>=0.7 && <0.12), text (==1.2.*), transformers (>=0.4 && <0.6) [details]
License BSD3
Copyright David Johnson (c) 2016
Author David Johnson, Dmitry Dzhus
Maintainer djohnson.m@gmail.com
Category Web
Source repository head: git clone https://github.com/dmjio/google-translate
Uploaded Sat Jul 29 01:35:02 UTC 2017 by DavidJohnson
Distributions NixOS:0.4.1, Stackage:0.4.1, Tumbleweed:0.3
Downloads 810 total (120 in the last 30 days)
Rating 2.25 (votes: 2) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2017-07-29 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for google-translate-0.4.1

[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.

{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import qualified Data.Text.IO as T
import Network.HTTP.Client
import Network.HTTP.Client.TLS
import Web.Google.Translate

main :: IO ()
main = do
  Right TranslationResponse { translations = xs } <-
    newManager tlsManagerSettings >>= \mgr ->
    translate mgr (Key "<API-Key>") (Just srcLang) trgLang (Body "Hello")
  forM_ xs $ \Translation { translatedText = TranslatedText txt } ->
    T.putStrLn txt
  where
    srcLang = Source English
    trgLang = Target Russian

-- >>> Здравствуйте