Respond to PR feedback: use method names not comments

This commit is contained in:
Nick Guerrera 2017-07-19 10:25:45 -07:00
parent a1c423c0f6
commit 85573db000
2 changed files with 9 additions and 5 deletions

View file

@ -199,7 +199,6 @@ namespace Microsoft.DotNet.Cli
// see the .NET Core Notes in https://msdn.microsoft.com/en-us/library/system.diagnostics.process(v=vs.110).aspx
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
// Honor UI language customization
UILanguageOverride.Setup();
}

View file

@ -15,15 +15,20 @@ namespace Microsoft.DotNet.Cli
public static void Setup()
{
CultureInfo language = GetOverriddenUILanguage();
if (language == null)
if (language != null)
{
return;
ApplyOverrideToCurrentProcess(language);
FlowOverrideToChildProcesses(language);
}
}
// Make the current process respect the override.
private static void ApplyOverrideToCurrentProcess(CultureInfo language)
{
CultureInfo.DefaultThreadCurrentUICulture = language;
}
// Pass down the override to other processes that we start via appropriate environment variables
private static void FlowOverrideToChildProcesses(CultureInfo language)
{
// Do not override any environment variables that are already set as we do not want to clobber a more granular setting with our global setting.
SetIfNotAlreadySet(DOTNET_CLI_UI_LANGUAGE, language.Name);
SetIfNotAlreadySet(VSLANG, language.LCID); // for tools following VS guidelines to just work in CLI