[Rd] restoring LANGUAGE env variable within an R session

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Mon Jun 26 15:15:27 CEST 2023


   I was playing around with the setting of the LANGUAGE variable and am 
wondering whether I'm missing something obvious about resetting the 
value to its original state once it's been set.  I seem to be able to 
reset the language for warnings/errors once, but not to change it a 
second time (or reset it) once it's been set ... ??

## default (no LANGUAGE set, English locale)
 > sqrt(-1)
[1] NaN
Warning message:
In sqrt(-1) : NaNs produced
## no complaints, doesn't change (as expected)
 > Sys.setenv(LANGUAGE = "en")
 > sqrt(-1)
[1] NaN
Warning message:
In sqrt(-1) : NaNs produced

## change to German
 > Sys.setenv(LANGUAGE = "de")
 > sqrt(-1)
[1] NaN
Warnmeldung:
In sqrt(-1) : NaNs wurden erzeugt

## try to change to Spanish - no luck
## (this does work in a clean session)

 > Sys.setenv(LANGUAGE = "es")
 > sqrt(-1)
[1] NaN
Warnmeldung:
In sqrt(-1) : NaNs wurden erzeugt

## try resetting to blank
 > Sys.setenv(LANGUAGE = "")
 > sqrt(-1)
[1] NaN
Warnmeldung:
In sqrt(-1) : NaNs wurden erzeugt

## or back to English explicitly?
 > Sys.setenv(LANGUAGE = "en")
 > sqrt(-1)
[1] NaN
Warnmeldung:
In sqrt(-1) : NaNs wurden erzeugt
 >



More information about the R-devel mailing list