Open daroczig opened 1 year ago
Is this for a context where withr::with_language()
won't help?
LANGUAGE=de R
sum('a')
# Fehler in sum("a") : ungültiger 'type' (character) des Argumentes
withr::with_language('en', sum('a'))
# Error in sum("a") : invalid 'type' (character) of argument
See also: Sys.setLanguage() in recent versions of R: https://search.r-project.org/R/refmans/base/html/gettext.html
When using R in a non-English message, searching the Internet for the translated error messages is difficult. So we should provide helpers functions to let the users easily switch to English and back.