rstudio / learnr

Interactive Tutorials with R Markdown
https://pkgs.rstudio.com/learnr
Apache License 2.0
705 stars 236 forks source link

tests: Skip i18n message translation tests when `LC_ALL="C"` or `"C.UTF-8"` #801

Closed gadenbuie closed 9 months ago

gadenbuie commented 9 months ago

This PR simply skips checking that learnr can control the language used for R's messages in known scenarios where the LANGUAGE environment variable is ignored. Currently this is true for LC_ALL="C" and with newer versions of glibc also for LC_ALL="C.UTF-8".

In an earlier iteration, I tried directly testing that if we are able to change the language of R message – by trying and succeeding or failing – but this create many more problems than it solved.

Fixes #800

Note that in the future we could maybe use Sys.setLanguage(), but this was added in R 4.2.0.