summaryrefslogtreecommitdiff
path: root/gtk/gtkimmodule.c
diff options
context:
space:
mode:
authorHidetoshi Tajima <tajima@src.gnome.org>2001-10-18 22:35:15 +0000
committerHidetoshi Tajima <tajima@src.gnome.org>2001-10-18 22:35:15 +0000
commitbeb13fa4cce89e2ae403fb60f8ca5ad8de5b70fa (patch)
tree02c9b74e924842381f997a92eaede32a26b8e325 /gtk/gtkimmodule.c
parent4e3ec883263f6cc6c3e42fdd66f67747434d9594 (diff)
downloadgdk-pixbuf-beb13fa4cce89e2ae403fb60f8ca5ad8de5b70fa.tar.gz
Support "*" for all locales with least priority when to select default im
* gtk/gtkimmodule.c (match_locale): Support "*" for all locales with least priority when to select default im module, #58201
Diffstat (limited to 'gtk/gtkimmodule.c')
-rw-r--r--gtk/gtkimmodule.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gtk/gtkimmodule.c b/gtk/gtkimmodule.c
index 7d882a293..1086d9fc6 100644
--- a/gtk/gtkimmodule.c
+++ b/gtk/gtkimmodule.c
@@ -441,20 +441,24 @@ _gtk_im_module_create (const gchar *context_id)
/* Match @locale against @against.
*
- * 'en_US' against 'en_US' => 3
- * 'en_US' against 'en' => 2
- * 'en', 'en_UK' against 'en_US' => 1
+ * 'en_US' against 'en_US' => 4
+ * 'en_US' against 'en' => 3
+ * 'en', 'en_UK' against 'en_US' => 2
+ * all locales, against '*' => 1
*/
static gint
match_locale (const gchar *locale,
const gchar *against,
gint against_len)
{
+ if (strcmp (against, "*") == 0)
+ return 1;
+
if (strcmp (locale, against) == 0)
- return 3;
+ return 4;
if (strncmp (locale, against, 2) == 0)
- return (against_len == 2) ? 2 : 1;
+ return (against_len == 2) ? 3 : 2;
return 0;
}