Opened 13 years ago
Last modified 4 years ago
#7819 assigned enhancement
Instant change of locale
Reported by: | deejam | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Kits/Locale Kit | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
When changing locale, applications should instantly redraw using the newly selected locale. In the current implementation, applications needs to be manually restarted before the new locale is activated.
Change History (10)
comment:1 by , 13 years ago
Component: | Servers/app_server → Kits/Locale Kit |
---|---|
Owner: | changed from | to
Summary: | [app_server] Instant change of locale → Instant change of locale |
comment:2 by , 13 years ago
Apps need to listen to the B_LOCALE_CHANGED message, as defined in LocaleRoster.h. It is sent by MutableLocaleRoster on settings change, so app just have to listen to it.
comment:3 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 13 years ago
This feature would be very useful for those who do localization. And it's a really nice feature overall.
follow-up: 6 comment:5 by , 13 years ago
The feature is working already. When changing locale, all applications get the B_LOCALE_CHANGED message and they have to reload thir catalog. ReadOnlyBootPrompt is a good example on how to relad a catalog.
comment:6 by , 13 years ago
Replying to pulkomandy:
The feature is working already. When changing locale, all applications get the B_LOCALE_CHANGED message and they have to reload thir catalog. ReadOnlyBootPrompt is a good example on how to relad a catalog.
Is it possible to implement a method in the appropriate kit that listens to B_LOCALE_CHANGED and make the change per default? If application developers do not want that to happen, they can override the method.
comment:7 by , 13 years ago
No. The locale kit can't track what you do with the strings you requested from it. So you have to tell all your views to refresh, or refresh your textmode display for CLI apps, or whatever. This needs careful coding because you must make sure you don't query for a string using B_TRANSLATE while you're in the process of switching catalogs. Whike it is possible to make sure this doesn't happen with locking on every B_TRANSLATE call, the result would be an even slower locale kit. Not really a nice idea. So, it's up to the application to handle that when it can do it safely.
comment:8 by , 10 years ago
Milestone: | R1 → Unscheduled |
---|
comment:9 by , 4 years ago
Upon changing the "primary locale", an alert window would be useful for nice UX, saying that the primary locale has been changed, and you might want to restart for changes to completely take effect.
Other than that, instant locale change is nice to have, but not paramount I think. A restart would always be better to make sure everything is properly initialised.
comment:10 by , 4 years ago
What is this, windows 95?
We should make this work live. It's not too convenient with the current API, but it's possible. Or we may decide that we prefer to wait until we change the API to make it simpler for developers.
In any case, there is no reason to restrart the whole system for a change of locale. We could consider restarting deskbar and tracker, maybe, since this can usually be done without too much problems (we have to be careful on checking if there are file copies or other operations in progress however).
That actually has nothing to do with the app_server ; redrawing isn't the problem, the app needs to be notified that the locale has changed so it can adapt (i.e. update the strings used on widgets, etc.). I don't recall if such a notification is sent already or not, but if it is then it's mostly a matter of updating the apps to react appropriately.