Nothing
#' @rdname translate
#' @title Translate text between languages
#' @description Translate text between languages
#' @param text A character string containing a text
#' @param from A two-letter language code specifying the language of the source text.
#' @param to two-letter language code specifying the language to translate in to.
#' @param \dots Additional arguments passed to \code{\link{translateHTTP}}.
#' @return A character string containing the translation.
#' @examples
#' \dontrun{
#' translate("hello world!", to = "fr")
#' }
#' @export
translate <-
function(text,
from = "en",
to,
...)
{
bod <- list(SourceLanguageCode = from,
TargetLanguageCode = to,
Text = text)
out <- translateHTTP(action = "TranslateText", body = bod, ...)
return(structure(out$TranslatedText,
SourceLanguageCode = out$SourceLanguageCode,
TargetLanguageCode = out$TargetLanguageCode))
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.