Skip to content

CultureInfo and CultureData use OS information to initialize culture routines on Windows - #35680

Merged
safern merged 5 commits into
dotnet:masterfrom
safern:CultureDataInfoWindows
May 4, 2020
Merged

safern merged 5 commits into
dotnet:masterfrom
safern:CultureDataInfoWindows

Conversation

@safern

@safern safern commented Apr 30, 2020

Copy link
Copy Markdown
Member

Fixes: #35638

ICU doesn't use OS data to get the default user settings in Windows for current culture, current UI culture and for current region.

cc: @tarekgh @jkotas @GrabYourPitchforks @jefgen

@ghost

ghost commented Apr 30, 2020

Copy link
Copy Markdown

Tagging subscribers to this area: @tarekgh, @safern, @krwq
Notify danmosemsft if you want to be subscribed.

@safern safern mentioned this pull request Apr 30, 2020
@jefgen

jefgen commented Apr 30, 2020

Copy link
Copy Markdown

ICU doesn't use OS data to get the default user settings in Windows for current culture, current UI culture and for current region.

Can you explain what you mean by this?

ICU on Windows should be picking up the NLS User Locale setting, often called the "Regional Format" setting. If this isn't happening then there's a serious bug going on.

For example, this is what the UI for the setting looks like in the Settings App on Windows 10:

image

@tarekgh

tarekgh commented Apr 30, 2020

Copy link
Copy Markdown
Member

@jefgen does ICU on Windows offer returning the Default UI language and default Region too?

@jefgen

jefgen commented Apr 30, 2020 •

Copy link
Copy Markdown

does ICU on Windows offer returning the Default UI language and default Region too?

@tarekgh: No, it currently does not. Probably the best way to think about ICU is that it is more like how NLS works (ie: locale data). On Windows, the NLS doesn't provide the Default UI language either, as that is from the MUI APIs, as the setting is owned by MUI.
The region is different though, as NLS does own the region setting and has APIs for it. However, AFAIK, the ICU currently doesn't have any concept of a default "region" for the host OS.

@tarekgh

tarekgh commented Apr 30, 2020

Copy link
Copy Markdown
Member

@jefgen thanks.

This change is mainly to get the default user and UI language and default region. We'll need to use NLS anyway for UI and Region, then I would say it doesn't matter if we use NLS for user locale too. so @safern changes here is reasonable to me.

@jefgen

jefgen commented Apr 30, 2020

Copy link
Copy Markdown

Sure, that sounds reasonable to me.
I just wanted to make sure that there wasn't some kind of horrible bug here with ICU, as when I read this part:

ICU doesn't use OS data to get the default user settings in Windows

I was concerned that maybe there was a bug and the ICU wasn't reading the NLS User Default Locale (which it should be).

Thanks for the replies and clarifications. :)

@tarekgh tarekgh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

modulo @jkotas comments, LGTM.

@safern

safern commented Apr 30, 2020

Copy link
Copy Markdown
Member Author

Thanks @jefgen 😄

@safern
safern force-pushed the CultureDataInfoWindows branch from 0966edf to 29ba3c0 Compare April 30, 2020 23:45
@safern
safern force-pushed the CultureDataInfoWindows branch from 57d2ea3 to ccf90c8 Compare May 2, 2020 00:40
@safern

safern commented May 4, 2020

Copy link
Copy Markdown
Member Author

Build is green, GH just didn't update.

@safern
safern merged commit bd4b9bd into dotnet:master May 4, 2020
@safern
safern deleted the CultureDataInfoWindows branch May 4, 2020 22:17
@ghost ghost locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Problem with UI Culture

6 participants