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

Build host should localize message output #74902

Closed
dibarbet opened this issue Aug 26, 2024 · 4 comments · Fixed by #74910
Closed

Build host should localize message output #74902

dibarbet opened this issue Aug 26, 2024 · 4 comments · Fixed by #74910

Comments

@dibarbet
Copy link
Member

See #74896

See https://github.com/dotnet/roslyn/blob/main/src/Workspaces/Core/MSBuild/MSBuild/BuildHostProcessManager.cs#L158

When starting the build host we do not pass the user value for DOTNET_CLI_UI_LANGUAGE to the build host, so the output is not localized. Likely we should just be passing this over to the build host.

There is an open question of what should happen if VSCode configures one language, and DOTNET_CLI_UI_LANGUAGE specifies a different one.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Aug 26, 2024
@jasonmalinowski
Copy link
Member

I would not expect us to directly listen to the environment variable. If we were going to support localization, I'd expect us to look at CurrentCulture or similar in that launch point and then pass that along as a switch to get it to be passed to the other process. The reason for distinction would be there's no requirement that MSBuildWorkspace be used in a process where DOTNET_CLI_UI_LANGUAGE is valid in the first place, and if we're running a .NET Framework host, we can't set the environment variable there.

@JoeRobich
Copy link
Member

If we were going to support localization, I'd expect us to look at CurrentCulture or similar in that launch point and then pass that along as a switch to get it to be passed to the other process.

I agree. Many users expect their VS Code Locale to take precedence.

@jasonmalinowski
Copy link
Member

@JoeRobich I think we already pass the locale over to Current[UI]Culture as a part of LSP command dispatching, right? So as long as MSBuildWorkspace does the right thing, this should hopefully work?

@JoeRobich
Copy link
Member

@jasonmalinowski Yes. I think we should pass the CurrentCulture as you suggest. Do not want to break the chain of VS Code locale -> Roslyn LSP -> BuildHost by looking at an environment variable.

@genlu genlu removed the untriaged Issues and PRs which have not yet been triaged by a lead label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@jasonmalinowski @JoeRobich @genlu @dibarbet and others