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

Force SDK locale to English #11836

Closed
thomaslevesque opened this issue May 31, 2020 · 8 comments
Closed

Force SDK locale to English #11836

thomaslevesque opened this issue May 31, 2020 · 8 comments
Assignees
Labels
untriaged Request triage from a team member

Comments

@thomaslevesque
Copy link
Member

Apparently the SDK for .NET 5 has been localized. I'm sure it's great for some people, but I don't want this. I want the SDK to "speak" English, not French.

My Windows language is English, with French regional settings (for date and number format, etc.)
(in other words, CurrentUICulture is English, CurrentCulture is French)

How do I force the SDK to use English?

@marcpopMSFT marcpopMSFT added the untriaged Request triage from a team member label Jun 10, 2020
@thomaslevesque
Copy link
Member Author

Any news on this?

For now, renaming the "fr" folder in %PROGRAMFILES%/dotnet/sdk/{version} seems to do the trick, but it feels like a hack...

@dasMulli
Copy link
Contributor

You should be able to set the DOTNET_CLI_UI_LANGUAGE environment variable to a different language.

@dasMulli
Copy link
Contributor

Do note that the SDK has been localized for a long time (1.0?), that override was added around the 2.0 timeframe i believe.
So it would be more interesting why it never was localized on your system to begin with..

@thomaslevesque
Copy link
Member Author

Thanks @dasMulli!

So it would be more interesting why it never was localized on your system to begin with..

I was wondering the same thing. I noticed the localization folders in previous versions of the SDK, but I never had to do anything to override the language before. Maybe the heuristics for selecting the default language have changed in 5.0?

@thomaslevesque
Copy link
Member Author

I'll close this issue, since there's a documented solution

@thomaslevesque
Copy link
Member Author

OK, I think I know what the problem is. It's not a problem with the CLI, but with .NET itself.

Consider the following code:

static void Main(string[] args)
{
    Console.WriteLine($"Culture:\t{CultureInfo.CurrentCulture}");
    Console.WriteLine($"UI Culture:\t{CultureInfo.CurrentUICulture}");
}

If I build and run it in .NET Core 3.1, the output is this:

Culture:        fr-FR
UI Culture:     en-US

(which is what I expect based on my system settings)

If I build and run it in .NET 5.0, the output is this:

Culture:        fr-FR
UI Culture:     fr-FR

It looks like .NET 5.0 only considers my regional settings, not my UI language.

@thomaslevesque
Copy link
Member Author

dotnet/runtime#37146

@thomaslevesque
Copy link
Member Author

It's fixed in preview 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

4 participants