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!')
}
klutometis/R-translate documentation built on Nov. 1, 2020, 1:30 p.m.