2

I installed R 3.2.2 on my Laptop(Mac Air), and the original language was Chinese.

I use system("defaults write org.R-project.R force.LANG en_US.UTF-8") to change language to English.

Then, the language on my R app(GUI) has changed. But in terminal R, the language still remain Chinese.

I use language = EN, the language could change.

After shutting down the terminal, the R on terminal still remain Chinese.

Were there someone met similar problem?

IRTFM
  • 258,963
  • 21
  • 364
  • 487
Han Zhengzu
  • 3,694
  • 7
  • 44
  • 94
  • Does this link help: [How to change language settings in R](http://stackoverflow.com/questions/13575180/how-to-change-language-settings-in-r). Here is also a link that talks about changing the [R console file](http://stackoverflow.com/questions/12760491/the-r-console-is-in-my-native-language-how-can-i-set-r-to-english). – steveb Mar 26 '16 at 15:43
  • The PATH environment variable is different when using R.app than it is when using Terminal.app. And then you throw in RStudio (a third platform, very slick but notorious for having inscrutable system interface issues on Macs) and the puzzle gets even more complex. And you also say "After shutting down the terminal, the R on terminal still remain Chinese." which needs clarification regarding what is actually happening. If you shut down Terminal.app, then how can R still "remain" doing anything? – IRTFM Mar 26 '16 at 16:25
  • Doing a bit more SO searching suggests that RStudio at one time documented this in their support area but the links all say "site closed". So use Sys.getenv() in all three systems and search RStudio new support area to see if maybe they moved those older answers to a new location. – IRTFM Mar 26 '16 at 16:40

1 Answers1

2

I know this is an old question, but for anyone else searching for a solution, you need to edit the ".bash_profile" file, which is a hidden file in your user directory. (See https://stackoverflow.com/a/36808124/4338841 if you're having trouble locating/opening the file. You will need to create the file if it doesn't exist.)

Then, add the following line to your .bash_profile file:

export LC_ALL=en_US

Save.

That's it! Close and reopen Terminal, run R and the default language should now be in English.

Mabyn
  • 316
  • 2
  • 20