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

[Bug]: DOTNET_CLI_UI_LANGUAGE ignored for English #9254

Closed
splendid25 opened this issue Sep 22, 2023 · 2 comments · Fixed by #9392
Closed

[Bug]: DOTNET_CLI_UI_LANGUAGE ignored for English #9254

splendid25 opened this issue Sep 22, 2023 · 2 comments · Fixed by #9392
Assignees
Labels

Comments

@splendid25
Copy link

Issue Description

Hello,
I think the parameter DOTNET_CLI_UI_LANGUAGE doesn't work for some languages.

MsBuild runs in French by default, as my OS is in French.
When I try to set the language to English(en or en-US), nothing changes, the output is still in French.

But for instance, Spanish works as expected.

I don't know if I missed something in the config ?

Thank you

Steps to Reproduce

dotnet new console
$msbuild = "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\amd64\MSBuild.exe"
& $msbuild
Version MSBuild 17.7.2+d6990bcfa pour .NET Framework
La génération a démarré 22/09/2023 12:30:37.

Tentative d'annulation de la génération en cours...
$env:DOTNET_CLI_UI_LANGUAGE="en"
& $msbuild
Version MSBuild 17.7.2+d6990bcfa pour .NET Framework
La génération a démarré 22/09/2023 12:31:09.

Tentative d'annulation de la génération en cours...
$env:DOTNET_CLI_UI_LANGUAGE="es"
& $msbuild
Versión de MSBuild 17.7.2+d6990bcfa para .NET Framework
Compilación iniciada a las 22/09/2023 12:32:56.

Intentando cancelar la compilación...

Expected Behavior

Output in English :

MSBuild version 17.7.2+d6990bcfa for .NET Framework
Build started 22/09/2023 14:01:39.

Attempting to cancel the build...

Actual Behavior

Output in French :

Version MSBuild 17.7.2+d6990bcfa pour .NET Framework
La génération a démarré 22/09/2023 12:31:09.

Tentative d'annulation de la génération en cours...

Analysis

The only way I could get it to work in English, is by setting the codepage.
Even then, it's half in english, half in french.

chcp 437
& $msbuild
MSBuild version 17.7.2+d6990bcfa for .NET Framework
Build started 22/09/2023 12:31:58.

Tentative d'annulation de la génération en cours...

But I can't use this codepage for my build as I need some accents to display properly. I just want the MsBuild messages to be localized in english.

Versions & Configurations

MSBuild version 17.7.2+d6990bcfa for .NET Framework
17.7.2.37605

@splendid25 splendid25 added bug needs-triage Have yet to determine what bucket this goes in. labels Sep 22, 2023
@JanKrivanek
Copy link
Member

FYI @nagilson

@nagilson
Copy link
Member

Hm, this is a bug 'by design' but it probably wasn't the right choice.

https://github.com/dotnet/msbuild/pull/8503/files#diff-10fe7d63f3421f0caa2b2f2c7b330995ee38aee0d904b38b4944f14e72388b9fR276 To fix this, this line would just need to be removed.

I wrote it that way to be disabled for EN languages because I figured it would be 'less breaking' to change the codepage / language if it was set to EN, because it was already correct by default for EN. But, it might make sense that you'd want to override it back to EN like the user is requesting!

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

Successfully merging a pull request may close this issue.

5 participants