-
Notifications
You must be signed in to change notification settings - Fork 1k
Allow CLI UI language to be overridden by an environment variable #7021
Conversation
|
Compilation error was a last minute parameter rename during self-review. I'll fix it tomorrow. |
|
Marking [NO MERGE] while I work on getting tests to exercise this. |
|
@nguerrera: Are you still planning to add some tests around this? |
|
Yes. I've been preempted this week back from vacation with some higher priority things, but it's not forgotten. |
Also fix some incorrect unlocalized test expectations that slipped in.
|
@livarcocc Test issue has been addressed. PTAL. |
| Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); | ||
|
|
||
| // Honor UI language customization | ||
| UILanguageOverride.Setup(); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| { | ||
| return new CultureInfo(dotnetCliLanguage); | ||
| } | ||
| catch (CultureNotFoundException) { } |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| { | ||
| return new CultureInfo(vsLcid); | ||
| } | ||
| catch (ArgumentOutOfRangeException) { } |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| } | ||
|
|
||
| // Make the current process respect the override. | ||
| CultureInfo.DefaultThreadCurrentUICulture = language; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
| CultureInfo language = GetOverriddenUILanguage(); | ||
| if (language != null) | ||
| { | ||
| ApplyOverrideToCurrentProcess(language); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
@dotnet-bot Test Ubuntu16.04 x64 Debug Build |
Customer scenario
Customizing the UI language for messages from the CLI and downstream tool without changing the user/system default globally.
Bugs this fixes:
#4988
Workarounds, if any
None
Risk
Low
Performance impact
None
Is this a regression from a previous update?
No
Root cause analysis:
This was planned work. We had considered leaving it until 2.1, but we need it now so that we can easily enable automated runs of unit tests with translation enabled.
How was the bug found?
Not a bug. The small feature was initially reported by a customer. And we also need it for loc testing.
@livarcocc @dotnet/dotnet-cli for review
@MattGertz for approval