dmjio / Google Translate
Licence: bsd-2-clause
㊙️ Google Translate API
Stars: ✭ 50
Programming Languages
haskell
3896 projects
google-translate
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
-- >>> Здравствуйте
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].