-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
MSBuild should respect upstream tool language requests #1596
Comments
VSLANG is sufficient for CLI and VS since we set that when the language is overridden by means other than VSLANG. |
Is there a workaround while this is still in development? I've tried:
and also:
to try to get the msbuild output to switch to English when using the |
Only option I know is to change the machine's language. |
It might be interesting for msbuild to do what CLI does and re-export other things like PreferredUILanguage. This would give the same compiler localization as dotnet build if you configure an env var. |
The BuildParameters class has |
|
I agree the UX is quite poor. I have been working to improve the UX in the .NET SDK/CLI, hoping to give it a try and migrate that same code here. Once that's been approved there. |
Setting DOTNET_CLI_UI_LANGUAGE=en helped for me. |
@chylex
Output: Executing task: C:\Program Files\dotnet\dotnet.exe build D:\Work\BadBroker/BadBroker/BadBroker.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary MSBuild version 17.4.1+9a89d02ff for .NET
As you can see there is only English output. If I delete DOTNET_CLI_UI_LANGUAGE environment variable then output looks like: Executing task: C:\Program Files\dotnet\dotnet.exe build D:\Work\BadBroker/BadBroker/BadBroker.csproj /property:GenerateFullPaths=true /consoleloggerparameters:NoSummary MSBuild version 17.4.1+9a89d02ff for .NET
|
Note: This only work for msbuild using |
This should be added & fixed in 8.0 preview 5! |
…8503) Fixes #1596 Changes Made SetConsoleUI now calls into a helper which sets the encoding to support non-en languages and checks if an environment variable exists to change the language to. Testing Setting DOTNET_CLI_UI_LANGUAGE=ja now changes msbuild correctly: image Doing a complicated build (aka building MSBuild) to use multiple threads shows other threads seem to use the same UI culture: image See that chcp remains the same after execution: image (Was set to 65001 temporarily but back to the original page before execution.) Notes Much of this code is a port of this code: dotnet/sdk#29755 There are some details about the code here. [!] In addition, it will introduce a breaking change for msbuild just like the SDK. The break is documented here for the sdk: dotnet/docs#34250
Not working for me in .NET 8... I have the I ended up going into |
Strangely, this only made MSBuild output, which was previously also localized, fallback to English, but the actual (I assume, dotnet) error message is still in Czech. I've also noticed that the I'm a bit lost here and quite frustrated. Why would anyone want development tools to be localized?
|
It looks like MSBuild's messages are in English but the C# compiler's are in Czech. @nagilson, does
To make things extra confusing, some of those |
Opinions on this vary widely, by individual dev and by culture--as I understand it many Europeans are on the "just give us English" side and many East Asian folks are strongly on "if it's in English it's useless, give me a translation". So we have to try to find compromises.
You'll have to take this up with JetBrains, that sounds like a Rider bug (or doc bug) to me. |
@rainersigwald There is no logic to set a special variable for Roslyn in the SDK or MSBuild to my knowledge (which should be most of the code.) I was not aware they had their own language variable, is that the case? It does set VSLANG. |
I would have expected VSLANG to do it . . . |
I looked at it again since its been a while. Actually, it looks like it sets PreferredUILang too, which it says is for C#/VB. |
Then maybe having English as default for Europeans would be a better compromise? I'm repeatedly frustrated with Microsoft's approach to localization of development tools, such as MSDN (Microsoft Learn?) randomly forcing terrible machine translations of documentation pages, which aren't even consistent with the translations in MSBuild / Roslyn, making it even more difficult to find anything! For example, Adam's example error message "Očekával se středník (;)." is apparently translated on https://learn.microsoft.com/cs-cz/dotnet/csharp/misc/cs1002 as "; Očekává", which is complete nonsense. Not to mention that comments in the example code on that page are still in English. This is not helpful at all. If you're not going to do localization properly, then don't make it the default option. If you are doing proper localization for East Asian languages, and they have a lot of resources on the internet in their language so it's easier for them to find help, then sure, default to localized for them. For my small european country in particular, this is not the case at all, and all it's doing is hurting communication and searchability. |
To be clear:
|
To clarify: we should expect everything in the build process to respect |
Exactly correct. But we know of the big can't-set- |
Understood, but
sorry, I'm not going to spend a month of my life reporting endless issues in awful machine translations on your documentation websites, which will only keep piling up as you continue to add new articles. At least MSBuild looks like it might be localized by humans, from the few bits of text I've seen, but what's happening in your online documentation is tragic. |
Different upstream tools have different language configuration requirements:
DOTNET_CLI_UI_LANGUAGE
andVSLANG
(MSBuild should respect upstream tool language requests #1596 (comment) https://github.com/dotnet/cli/issues/9722#issuecomment-409358296)VSLANG
environmnent variable/lcid
command line switchGetConsoleFallbackUICulture
(we only do this currently)Related info: https://github.com/dotnet/cli/issues/4988#issuecomment-266836559
The text was updated successfully, but these errors were encountered: