-
Notifications
You must be signed in to change notification settings - Fork 319
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
skip_if_localized() #565
Comments
Or we could add a language parameter to |
Hmmm, how do we know if you're localised? |
Maybe |
This should be better I guess: https://github.com/wch/r-source/blob/0af92cb369681f3ef666451a6eeb895988c04113/tests/reg-tests-1d.R#L13-L29 |
Something like is_english <- function() {
lang <- Sys.getenv("LANGUAGE")
if (identical(lang, "en")) {
return(TRUE)
}
if(.Platform$OS.type == "windows") {
lc <- sub("\\..*", "", sub("_.*", "", Sys.getlocale("LC_CTYPE")))
lc == "English" || lc == "C"
} else {
lc <- sub("\\..*", "", Sys.getlocale("LC_MESSAGES"))
lc == "C" || substr(lc, 1, 2) == "en"
}
} |
We need a different name because of localized vs localised. Maybe |
This feels awkward - I'd rather add a lang parameter to |
Unfortunately it looks like that gettext caches translations between calls making it difficult to switch languages back and forth in a single session. I'll go back to |
to be able to skip tests that check the wording of an error message and fail in a non-English locale.
The text was updated successfully, but these errors were encountered: