Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmjio/google-translate
:secret: Google Translate API
https://github.com/dmjio/google-translate
google-translate haskell servant servant-client
Last synced: about 1 month ago
JSON representation
:secret: Google Translate API
- Host: GitHub
- URL: https://github.com/dmjio/google-translate
- Owner: dmjio
- License: bsd-2-clause
- Created: 2015-09-14T01:27:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2020-12-20T10:58:30.000Z (about 4 years ago)
- Last Synced: 2024-04-15T14:22:42.345Z (8 months ago)
- Topics: google-translate, haskell, servant, servant-client
- Language: Haskell
- Homepage: http://hackage.haskell.org/package/google-translate
- Size: 30.3 KB
- Stars: 50
- Watchers: 3
- Forks: 7
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
google-translate
====================
![Hackage](https://img.shields.io/hackage/v/google-translate.svg)
![Hackage Dependencies](https://img.shields.io/hackage-deps/v/google-translate.svg)
![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-blue.svg)
![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)
![Build Status](https://img.shields.io/circleci/project/dmjio/google-translate.svg)High-level, up-to-date bindings to the Google Translate API.
```haskell
{-# LANGUAGE OverloadedStrings #-}
import Control.Monad
import qualified Data.Text.IO as T
import Network.HTTP.Client
import Network.HTTP.Client.TLS
import Web.Google.Translatemain :: IO ()
main = do
Right TranslationResponse { translations = xs } <-
newManager tlsManagerSettings >>= \mgr ->
translate mgr (Key "") (Just srcLang) trgLang (Body "Hello")
forM_ xs $ \Translation { translatedText = TranslatedText txt } ->
T.putStrLn txt
where
srcLang = Source English
trgLang = Target Russian-- >>> Здравствуйте
```