Opened 5 years ago
Closed 5 years ago
#15933 closed enhancement (no change required)
Add event when the preferred locale changes
Reported by: | icculus | Owned by: | pulkomandy |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Kits/Locale Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
So I'm working on filling in locale support in SDL:
https://bugzilla.libsdl.org/show_bug.cgi?id=2131#c19
The idea is that you can ask SDL what the user's list of preferred languages is (which on Haiku, eventually becomes a call to BLocaleRoster::Default()->GetPreferredLanguages()). That part is working here.
Optionally, SDL can send an event to alert the user that this list has changed, so they know to requery if they care. There are ways to do this on Windows and macOS, but there doesn't appear to be one in Haiku.
Can we have one? :) Something that apps can see when the Locale preference panel sees a change, the same way that I presume B_FONTS_UPDATED and B_COLORS_UPDATED work.
This isn't life or death--platforms without such an event just don't alert apps of the system preference change--but it would be a nice enhancement to have.
Thanks, --ryan.
Change History (4)
comment:1 by , 5 years ago
Component: | - General → Kits/Locale Kit |
---|---|
Owner: | changed from | to
comment:2 by , 5 years ago
There is already a B_LOCALE_CHANGED event that is broadcast. DeskBar uses it for example (and sometimes it crashes when doing it: easy to reproduce if you start FirstBootPrompt and use arrow keys to browse quickly through the language list).
FirstBootPrompt is a bit special I think, because it changes the locale itself.
It seems the message is automatically broadcast to all BViews and BApplication.
comment:3 by , 5 years ago
Argh, whoops, you're right. I was looking at both the wrong header for the event, _and_ the wrong class for handling the event. This is already available and functions as intended. Sorry!
--ryan.
comment:4 by , 5 years ago
Resolution: | → no change required |
---|---|
Status: | new → closed |
we should probably document it better, still
I though there was already a ticket about changing locale in all open apps on the fly but I can't seem to find it. IIRC, locale change broadcasts to all of the apps but only few implement reacting on that. I think only FirstBootPrompt does that?