Re: [Rd] restoring LANGUAGE env variable within an R session

2023-06-26 Thread Ben Bolker
Thanks, this is exactly PR#18055. Should have looked (but assumed I was probably just overlooking something ...) On 2023-06-26 10:02 a.m., Sebastian Meyer wrote: Translated strings are cached. I'd recommend to use the     • New partly experimental Sys.setLanguage() utility, solving the    

Re: [Rd] restoring LANGUAGE env variable within an R session

2023-06-26 Thread Sebastian Meyer
Translated strings are cached. I'd recommend to use the • New partly experimental Sys.setLanguage() utility, solving the main problem of PR#18055. introduced in R 4.2.0. Best, Sebastian Meyer Am 26.06.23 um 15:15 schrieb Ben Bolker: I was playing around with the

Re: [Rd] restoring LANGUAGE env variable within an R session

2023-06-26 Thread Ben Bolker
That's reasonable, but I'm wondering why it works the *first* time it's called in a session. Is this just undefined behaviour (so I shouldn't be surprised whatever happens)? Again, $ Rscript -e 'sqrt(-1); Sys.setenv(LANGUAGE="es"); sqrt(-1)' [1] NaN Warning message: In sqrt(-1) : NaNs

Re: [Rd] restoring LANGUAGE env variable within an R session

2023-06-26 Thread Eric Berger
There is also some inconsistency. Even though sqrt(-1) returns the warning/error about NaNs in German after setting the language to Spanish, if you give the command > messages() it will respond in Spanish. On Mon, Jun 26, 2023 at 4:39 PM Dirk Eddelbuettel wrote: > > > Ben, > > POSIX level /

Re: [Rd] restoring LANGUAGE env variable within an R session

2023-06-26 Thread Dirk Eddelbuettel
Ben, POSIX level / glibc level variables are set at process start and AGAIK cannot really be altered after start. They clearly work when set _before_ calling sqrt(-1): $ LANGUAGE=es Rscript -e 'sqrt(-1)' [1] NaN Warning message: In sqrt(-1) : Se han producido NaNs $