## Description: Use LC_MESSAGES instead of LC_ALL in bus_ibus_impl_set_default_preload_engines ## Origin/Author: Yusuke Sato ## Bug: http://code.google.com/p/ibus/issues/detail?id=1204 Index: ibus-1.3.9/bus/ibusimpl.c =================================================================== --- ibus-1.3.9.orig/bus/ibusimpl.c 2011-02-19 23:11:57.780435000 +0900 +++ ibus-1.3.9/bus/ibusimpl.c 2011-02-19 23:13:11.220435000 +0900 @@ -329,6 +329,11 @@ return - ((gint) desc1->rank) + ((gint) desc2->rank); } +/** + * bus_ibus_impl_set_default_preload_engines: + * + * If the "preload_engines" config variable is not set yet, set the default value which is determined based on a current locale. + */ static void bus_ibus_impl_set_default_preload_engines (BusIBusImpl *ibus) { @@ -351,7 +356,14 @@ } done = TRUE; - lang = g_strdup (setlocale (LC_ALL, NULL)); + + /* The setlocale call first checks LC_ALL. If it's not available, checks + * LC_CTYPE. If it's also not available, checks LANG. */ + lang = g_strdup (setlocale (LC_CTYPE, NULL)); + if (lang == NULL) { + return; + } + p = index (lang, '.'); if (p) { *p = '\0';