Sdk: Switch CLI to a non-system language

Created on 2 Sep 2017  Â·  16Comments  Â·  Source: dotnet/sdk

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

Most helpful comment

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).

All 16 comments

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...

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).

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.

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!

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

cc @nguerrera

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

@nguerrera dotnet watch run

Does this repro when you just do dotnet build?

@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!

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.

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

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

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

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

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

Was this page helpful?
0 / 5 - 0 ratings