Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch CLI to a non-system language #8686

Closed
TomasHubelbauer opened this issue Sep 2, 2017 · 18 comments
Closed

Switch CLI to a non-system language #8686

TomasHubelbauer opened this issue Sep 2, 2017 · 18 comments
Assignees

Comments

@TomasHubelbauer
Copy link

How do I make the dotnet CLI be in English when I'm on non-English Windows?

@johnbeisner
Copy link
Contributor

johnbeisner commented Sep 13, 2017

I have changed the language from English to something else on an English OS - however, it's probably the same technique:
In your command shell; set the environmental variable "DOTNET_CLI_UI_LANGUAGE" to "en"

If that doesn't work - try setting "DOTNET_CLI_UI_LANGUAGE" to nothing

Let me know if that works - I'm now curious...

@johnbeisner johnbeisner self-assigned this Sep 13, 2017
@TomasHubelbauer
Copy link
Author

Thank you @johnbeisner, setx DOTNET_CLI_UI_LANGUAGE en seems to have had the desired effect.

FWIW I think this is a bad default and changing language away from English to the system language should be opt-in (dismissable hint to do it is fine though).

@TomasHubelbauer
Copy link
Author

TomasHubelbauer commented Sep 19, 2017

Sorry, this did not end up working out after all. I am now receiving CSC : warning CS2038: Nazev jazyka cz je neplatny ('cs' language code in invalid).

In my <project>.AssemblyInfo.cs file I have Czech generated comments. :-( The CLI is in English though…

Really hope there is a straightforward way to just switch everything to English and ignore the system language, because I sometimes have to work on a machine with Home edition which won't allow me to switch languages and this is extremely frustrating.

@TomasHubelbauer
Copy link
Author

TomasHubelbauer commented Sep 19, 2017

Change compiler errors language in Visual Studio 2013

I removed cs and cs-CZ directories in the mentioned path and now things are in English!

@TomasHubelbauer
Copy link
Author

And it stayed that way for exactly one compiler invocation. Deleted 1029 afterwards to no avail. It's in Czech again.

@livarcocc
Copy link
Contributor

cc @nguerrera

@nguerrera
Copy link
Contributor

@TomasHubelbauer How are you invoking the compilation: msbuild or dotnet build?

@TomasHubelbauer
Copy link
Author

@nguerrera dotnet watch run

@livarcocc
Copy link
Contributor

Does this repro when you just do dotnet build?

@TomasHubelbauer
Copy link
Author

TomasHubelbauer commented Nov 11, 2017

@livarcocc I have just noticed DOTNET_CLI_UI_LANGUAGE remained set to cz, I must have set it only for the PowerShell session when I tried changing it the last time. Aplogies.

This, presumably combined with the fact that I have deleted the resource directories, now made the compiler spit out warning CS2038 about cz language code not being valid (configured cz in DOTNET_CLI_UI_LANGUAGE but the 1029 [Czech] directory is missing).

At this point, the warning is in Czech (?!) but the exception messages thrown during the execution of the program are in English. The obj/Debug/AssemblyInfo.cs generated file still has Czech comments.

So I have set the variable using [Environment]::SetEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE", "en", "User") as opposed to $Env:DOTNET_CLI_UI_LANGUAGE=en I must have used previously, logged out and back in and it finally works and I have almost everything in English. 💯

The obj/Debug/AssemblyInfo.cs generated file still has Czech comments, but the language code warning is gone and exception messages are in English, so I think I will be able to live with that.

Thank you!

@msftgits msftgits transferred this issue from dotnet/cli Jan 31, 2020
@nelsontkq
Copy link

nelsontkq commented Apr 13, 2020

I cannot get an english output for dotnet on Linux Ubuntu 19.04 even with DOTNET_CLI_UI_LANGUAGE set.

FWIW I think this is a bad default and changing language away from English to the system language should be opt-in (dismissable hint to do it is fine though).

Yes exactly this, I appreciate the language change but whenever I'm trying to debug I need to be able to get the verbage in English for better results.

@KacperBak
Copy link

I cannot get an english output for dotnet on Linux Ubuntu 19.04 even with DOTNET_CLI_UI_LANGUAGE set.

FWIW I think this is a bad default and changing language away from English to the system language should be opt-in (dismissable hint to do it is fine though).

Yes exactly this, I appreciate the language change but whenever I'm trying to debug I need to be able to get the verbage in English for better results.

Same here on OSX
export DOTNET_CLI_UI_LANGUAGE="en-US" or export DOTNET_CLI_UI_LANGUAGE="en" has no effect.

Some details

dotnet --info
.NET Core SDK (reflecting any global.json):
 Version:   3.1.102
 Commit:    573d158fea

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.15
 OS Platform: Darwin
 RID:         osx.10.15-x64
 Base Path:   /usr/local/share/dotnet/sdk/3.1.102/

Host (useful for support):
  Version: 3.1.2
  Commit:  916b5cba26

@sergeyzwezdin
Copy link

@KacperBak have you managed to switch to English in macOS?

@stysiok
Copy link

stysiok commented Oct 4, 2020

@sergeyzwezdin try to switch your mac language to English. It worked for me.

@sergeyzwezdin
Copy link

@stysiok well, it will definitely work :-) But I wouldn't like to change OS language only just for that.

@sergeyzwezdin
Copy link

For macOS setting export LANG=en_US.UTF-8 in .zshrc helped to switch CLI to English 🎉

@hhhfriends19
Copy link

For macOS setting export LANG=en_US.UTF-8 in .zshrc helped to switch CLI to English 🎉

Thanks, bro

@SonrakiYazilimci
Copy link

I have changed the language from English to something else on an English OS - however, it's probably the same technique: In your command shell; set the environmental variable "DOTNET_CLI_UI_LANGUAGE" to "en"

If that doesn't work - try setting "DOTNET_CLI_UI_LANGUAGE" to nothing

Let me know if that works - I'm now curious...

This worked for me ! Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants