Typedefs | |
typedef void() | osso_locale_change_cb_f (const char *new_locale, gpointer data) |
Functions | |
osso_return_t | osso_locale_change_set_notification_cb (osso_context_t *osso, osso_locale_change_cb_f *cb, gpointer data) |
osso_return_t | osso_locale_set (osso_context_t *osso, char *new_locale) |
|
This is the type for the locale change notification callback function.
ExampleThis is an example implementation of the locale change callback function. It correctly passes the received locale value to gettext and updates the labels for all the text widgets in the application. #include <libintl.h> #include <locale.h> #include <glib.h> static void locale_changed_cb (char *new_locale, gpointer user_data) { GtkWidget *my_label = GTK_WIDGET (user_data); g_setenv ("LANG", new_locale, TRUE); setlocale (LC_MESSAGES, new_locale); // Here you re-set the text labels for all your widgets. In this example // only one widget is passed into the callback via user_data. gtk_label_set_text (GTK_LABEL (my_label), _("Label Text")); // The label's text will now be rendered in the new language } |
|
This function registers a callback that is called whenever the locale is changed.
|
|
This function issues a notification over the D-Bus system bus indicating a change of locale. To receive such a notification, install a callback function with osso_locale_change_set_notification_cb.
|