tests/tests.R

library(translate)

if (is.null(get.key())) {
  message("No API key is set; not running tests.")
} else {
  stopifnot(detect.source('hello') == 'en')
  stopifnot(length(languages(target='de')) == 53)
  stopifnot(translate('hello, world', 'en', 'de') == 'Hallo Welt!')
}

Try the translate package in your browser

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

translate documentation built on May 2, 2019, 1:29 p.m.