Opened 8 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:
Has a Patch: no 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 (8)

comment:1 Changed 8 years ago by anevilyak

Component: Servers/app_serverKits/Locale Kit
Owner: changed from axeld to pulkomandy
Summary: [app_server] Instant change of localeInstant change of locale

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.

comment:2 Changed 8 years ago by pulkomandy

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.

Last edited 8 years ago by pulkomandy (previous) (diff)

comment:3 Changed 7 years ago by pulkomandy

Owner: changed from pulkomandy to nobody
Status: newassigned

comment:4 Changed 7 years ago by diver

This feature would be very useful for those who do localization. And it's a really nice feature overall.

comment:5 Changed 7 years ago by 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.

comment:6 in reply to:  5 Changed 7 years ago by deejam

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 Changed 7 years ago by pulkomandy

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 Changed 4 years ago by pulkomandy

Milestone: R1Unscheduled
Note: See TracTickets for help on using tickets.