google-translate-0.1.1.1: Google Translate API bindings

Copyright(c) David Johnson 2015
Maintainerdjohnson.m@gmail.com
Stabilityexperimental
PortabilityPOSIX
Safe HaskellNone
LanguageHaskell2010

Web.Google.Translate

Contents

Description

 

Synopsis

Functions

detect :: Key -> Body -> IO (Either ServantError DetectionResponse) Source

Detect target language

getLanguages :: Key -> Maybe Target -> IO (Either ServantError LanguageResponse) Source

Retrieve all languages If Target specified, return langauge name in Target langauge.

translate :: Key -> Maybe Source -> Target -> Body -> IO (Either ServantError TranslationResponse) Source

Perform translation from Source language to Target langauge. If Source not specified, attempt detection of Lang

API

type GoogleTranslateAPI = ("language" :> ("translate" :> ("v2" :> (QueryParam "key" Key :> (QueryParam "source" Source :> (QueryParam "target" Target :> (QueryParam "q" Body :> Get `[JSON]` TranslationResponse))))))) :<|> (("language" :> ("translate" :> ("v2" :> ("detect" :> (QueryParam "key" Key :> (QueryParam "q" Body :> Get `[JSON]` DetectionResponse)))))) :<|> ("language" :> ("translate" :> ("v2" :> ("languages" :> (QueryParam "key" Key :> (QueryParam "target" Target :> Get `[JSON]` LanguageResponse))))))) Source

Google Translate API

Types

newtype Key Source

API Key

Constructors

Key Text 

newtype Source Source

Source Language

Constructors

Source Lang 

newtype Target Source

Target Language

Constructors

Target Lang 

newtype Body Source

Text for translation

Constructors

Body Text