argh
argh copied to clipboard
lang params use Sys.getenv("LANGUAGE") result?
how about use lang params Sys.getenv("LANGUAGE") ??
That would work, but on a general basis, I prefer not to mess with environment variables :)
Any reason this would be better than the current implementation?
Sys.getenv("LANGUAGE") is already used variables. that's why I suggest.
Ah, that makes sense indeed!
I thought you were suggesting to ask the user to set an environment variable or to set a variable with a function.
We should make it optional though, I'm not sure it's set on every machine.
get_sys_lang <- function(){
if (!is.null(Sys.getenv("LANG")) && Sys.getenv("LANG") != ""){
gsub("([^\\.]*)\\..*", "\\1", Sys.getenv("LANG"))
} else {
invisible(NULL)
}
Also, it should also be possible for the user to prevent the use of the env variable