Re: [Rd] Testing for English locale

From: Simon Urbanek <simon.urbanek_at_r-project.org>
Date: Mon 01 Aug 2005 - 15:35:43 GMT

On Aug 1, 2005, at 10:20 AM, John Fox wrote:

> Is there a platform-independent way to test whether R is running in
> an English locale?

I suppose the following should work:

Sys.getlocale("LC_CTYPE")=="C" || length(grep("^en",Sys.getlocale ("LC_CTYPE"),TRUE))>0 Basically unix platforms will have "C" or "en_..."; Windows has "English...". You could make the check more strict depending on the platform if desired ..

Cheers,
Simon



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Aug 02 01:49:54 2005

This archive was generated by hypermail 2.1.8 : Mon 24 Oct 2005 - 22:27:32 GMT