Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get last error msg in a different lang #2

Open
richierocks opened this issue Jul 6, 2017 · 0 comments
Open

Get last error msg in a different lang #2

richierocks opened this issue Jul 6, 2017 · 0 comments

Comments

@richierocks
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant