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

Use Culture Specified by User in case it differs with that of OS #1712

Merged
merged 9 commits into from
Aug 3, 2018
Merged

Use Culture Specified by User in case it differs with that of OS #1712

merged 9 commits into from
Aug 3, 2018

Conversation

mayankbansal018
Copy link
Contributor

@mayankbansal018 mayankbansal018 commented Aug 1, 2018

Description

Set Current Culture to be the one propagated by dotnet via DOTNET_CLI_UI_LANGUAGE

Test:
set DOTNET_CLI_UI_LANGUAGE=fr
run vstest.console /?

You should see help displayed in french

Related issue

Fixes #821.

CultureInfo.DefaultThreadCurrentUICulture = info;
}
catch (Exception)
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do EqtTrace here. ConsoleOutput not useful in datacollector process.


private static void SetCultureSpecifiedByUser()
{
var userCultureSpecified = Environment.GetEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY.

return new Executor(ConsoleOutput.Instance).Execute(args);
}

private static void SetCultureSpecifiedByUser()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DRY.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Specify where it should be common for all these 3 different application

try
{
CultureInfo info = new CultureInfo(userCultureSpecified);
CultureInfo.DefaultThreadCurrentUICulture = info;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add example testing to PR description.

try
{
CultureInfo info = new CultureInfo(userCultureSpecified);
CultureInfo.DefaultThreadCurrentCulture = info;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In CLI, we don't change the formatting culture (CurrentCulture) based on DOTNET_CLI_UI_LANGUAGE, only the translation culture (CurrentUICulture).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@mayankbansal018
Copy link
Contributor Author

@acesiddhu , @singhsarab , @smadala , Can one of you review it?

Copy link
Contributor

@smadala smadala left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add required tests.

@mayankbansal018
Copy link
Contributor Author

added tests for app domain culture

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

Successfully merging this pull request may close these issues.

3 participants