-
Notifications
You must be signed in to change notification settings - Fork 323
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
Conversation
CultureInfo.DefaultThreadCurrentUICulture = info; | ||
} | ||
catch (Exception) | ||
{ |
There was a problem hiding this comment.
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.
src/testhost.x86/Program.cs
Outdated
|
||
private static void SetCultureSpecifiedByUser() | ||
{ | ||
var userCultureSpecified = Environment.GetEnvironmentVariable("DOTNET_CLI_UI_LANGUAGE"); |
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DRY.
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@acesiddhu , @singhsarab , @smadala , Can one of you review it? |
There was a problem hiding this 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.
added tests for app domain culture |
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.