R/microsoftTranslate.R

Defines functions microsoftTranslate

microsoftTranslate <-
function(x, access.token, source.lang, target.lang){
    params = paste("text=", URLencode(x), "&to=", target.lang, "&from=", source.lang, sep = '')
    translateUrl = paste("http://api.microsofttranslator.com/v2/Http.svc/Translate?", params, sep = '')
    
    return(
        cleanFun(
            GET(translateUrl, add_headers(Authorization = paste('Bearer', access.token)))
            )
        )
}

Try the translateR package in your browser

Any scripts or data that you put into this service are public.

translateR documentation built on May 30, 2017, 5:36 a.m.