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 year 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 10 years ago)
- Default Branch: master
- Last Pushed: 2024-12-14T00:44:42.000Z (over 1 year ago)
- Last Synced: 2025-03-27T21:23:15.084Z (about 1 year ago)
- Topics: google-translate, haskell, servant, servant-client
- Language: Haskell
- Homepage: http://hackage.haskell.org/package/google-translate
- Size: 32.2 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
====================





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.Translate
main :: 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
-- >>> Здравствуйте
```