google-translate: Google Translate API bindings

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain]

Warnings:

Google Translate Library


[Skip to ReadMe]

Properties

Versions0.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, 0.5
Change logNone available
Dependenciesaeson, base (>=4.7 && <5), bytestring (==0.10.*), http-api-data (>=0.2 && <0.4), http-client (>=0.4 && <0.6), servant (>=0.13), servant-client (>=0.13), text (==1.2.*), transformers (>=0.4 && <0.6) [details]
LicenseBSD-3-Clause
CopyrightDavid Johnson (c) 2018
AuthorDavid Johnson, Dmitry Dzhus
Maintainerdjohnson.m@gmail.com
CategoryWeb
Source repositoryhead: git clone https://github.com/dmjio/google-translate
UploadedMon May 7 11:42:36 UTC 2018 by DavidJohnson

Modules

[Index]

Downloads

Maintainers' corner

For package maintainers and hackage trustees


Readme for google-translate-0.5

[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

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