R/star-wars.R

Defines functions translate_yoda translate_sith translate_gungan translate_huttese translate_mandalorian translate_cheunh

Documented in translate_cheunh translate_gungan translate_huttese translate_mandalorian translate_sith translate_yoda

#' Yoda translator
#'
#' Convert from English to Yoda speak.
#'
#' @param text Text to be converted.
#'
#' @examples
#' \dontrun{
#' translate_yoda("What nonsense is this?")
#' }
#'
#' @export
#'
translate_yoda <- function(text) {

  if (pingr::is_online()) {
    prep_translate(text, "yoda")
  } else {
    stop("Please check your internet connection.", call. = FALSE)
  }

}

#' Sith translator
#'
#' Convert from English to Sith language.
#'
#' @param text Text to be converted.
#'
#' @examples
#' \dontrun{
#' translate_sith("What nonsense is this?")
#' }
#'
#' @export
#'
translate_sith <- function(text) {

  if (pingr::is_online()) {
    prep_translate(text, "sith")
  } else {
    stop("Please check your internet connection.", call. = FALSE)
  }

}

#' Gungan translator
#'
#' Convert from English to Gungan language.
#'
#' @param text Text to be converted.
#'
#' @examples
#' \dontrun{
#' translate_gungan("What nonsense is this?")
#' }
#'
#' @export
#'
translate_gungan <- function(text) {

  if (pingr::is_online()) {
    prep_translate(text, "gungan")
  } else {
    stop("Please check your internet connection.", call. = FALSE)
  }

}

#' Huttese translator
#'
#' Convert from English to Huttese language.
#'
#' @param text Text to be converted.
#'
#' @examples
#' \dontrun{
#' translate_huttese("What nonsense is this?")
#' }
#'
#' @export
#'
translate_huttese <- function(text) {

  if (pingr::is_online()) {
    prep_translate(text, "huttese")
  } else {
    stop("Please check your internet connection.", call. = FALSE)
  }

}

#' Mandalorian translator
#'
#' Convert from English to Mandalorian language.
#'
#' @param text Text to be converted.
#'
#' @examples
#' \dontrun{
#' translate_mandalorian("What nonsense is this?")
#' }
#'
#' @export
#'
translate_mandalorian <- function(text) {

  if (pingr::is_online()) {
    prep_translate(text, "mandalorian")
  } else {
    stop("Please check your internet connection.", call. = FALSE)
  }

}

#' Cheunh translator
#'
#' Convert from English to Cheunh language.
#'
#' @param text Text to be converted.
#'
#' @examples
#' \dontrun{
#' translate_cheunh("What nonsense is this?")
#' }
#'
#' @export
#'
translate_cheunh <- function(text) {

  if (pingr::is_online()) {
    prep_translate(text, "cheunh")
  } else {
    stop("Please check your internet connection.", call. = FALSE)
  }

}
rsquaredacademy/funtranslater documentation built on May 21, 2019, 10:49 a.m.