Closed Bug 1337067 Opened 7 years ago Closed 2 years ago

Improve the use of Win32 API in OSPreferences

Categories

(Core :: Widget: Win32, enhancement, P3)

enhancement

Tracking

()

RESOLVED DUPLICATE of bug 1593414

People

(Reporter: zbraniecki, Unassigned, Mentored)

References

Details

(Keywords: good-first-bug, Whiteboard: tpi:+)

Attachments

(1 file)

In bug 1333184 we're introducing OSPreferences API. In this bug we'll work on using more of the Win32 API to handle more of the information from the OS.
Depends on: 1333184
Severity: normal → enhancement
Priority: -- → P3
Whiteboard: tpi:+
Attached image screenshot1.PNG
It seems that the current API does not return the current system locale in Windows 10.

Since this code is what we use to retrieve system locale for telemetry (among others) is may mean that we have incorrect data about user system locales...
On Win32 and Mac, nsSystemInfo already includes a "countryCode" property that includes the ISO 2-character country code. I know that isn't a complete solution, but at least part of the required code already exists somewhere.
I take that back; I think that countryCode reflects the user's current location (if available), not necessarily the configured locale.
Mentor: gandalf
Keywords: good-first-bug
I got a feedback on our use of WinAPI from Microsoft's Jeff Genovy.

It seems that since we dropped support for Windows XP we can switch away from using LCIDs.
More feedback from Microsoft:

 - they separate three, relevant to us, classes of locales:
   - Display Locale: the locale Windows is localized to
   - App locale: the locale user selected for apps to be in (including WIndows Store apps)
   - User locale: the locale regional preferences should be in.

It seems that at the moment we use the User locale for RegionalPrefs which is the right match (yay!) and we use something pretty obsolete and wrong for the OSPreferences:SystemLocale.

SystemLocale serves multiple roles in Gecko:
 - inform telemetry on user's OS locale
 - inform our font fallbacking
 - (future use)inform our UI locale selection

We may end up wanting to separate those two APIs:
 - Display Locale for telemetry and fonts
 - App locale for our UI locale selection and fonts


I'm not sure how to name the new variable/API - I like `OSPreferences:SystemLocale` as the name of the OS locale (Display Locale on Windows), so the new name would be for the locale that Windows has set for the apps to be in.
Maybe `OSPreferences::AppLocales` or `OSPreferences::RequestedAppLocales`?
Depends on: 1414186

I would like to work on this bug.

OSPreferences has changed substantially since it first landed. Is this bug still relevant? If so, what specific things should be implemented here?

Flags: needinfo?(zibi)

Moving NI to Greg and Dan who are taking over this area.

Flags: needinfo?(zibi)
Flags: needinfo?(gtatum)
Flags: needinfo?(dminor)

:jkew reworted OSPreferences::ReadSystemLocales quite a bit in Bug 1593414, so I think we're ok to close this one.

Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(gtatum)
Flags: needinfo?(dminor)
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: