RL10N/autotranslate

Get last error msg in a different lang

Opened this issue · 0 comments

Something like

le <- function(lang_to = Sys.getenv("LANG"), api_key, engine = c("microsoft", "google")) {
  msg <- geterrmessage()
  if(msg == "") {
    message("There is no error to translate.")
    return("")
  }
  engine <- match.arg(engine)
  get_translations(msg, lang_to, api_key, engine = engine)
}

Need to convert LANG env var to ISO lang format. Need to deal with both engines better. e.g., auto supply API key.