Index: gok/main.c
===================================================================
RCS file: /cvs/gnome/gok/gok/main.c,v
retrieving revision 1.124
diff -u -r1.124 main.c
--- gok/main.c	17 Nov 2003 13:55:51 -0000	1.124
+++ gok/main.c	19 Nov 2003 00:09:50 -0000
@@ -1349,7 +1349,7 @@
     GError *gconf_err = NULL;
     gchar *directory_name = NULL;
     gboolean gconf_keyboard_directory_error = FALSE;
-
+	
     gconf_client = gconf_client_get_default ();
     
     directory_name = gconf_client_get_string (gconf_client,
@@ -1400,16 +1400,40 @@
 	struct dirent* pDirectoryEntry;
 	gchar* filename;
 	gchar* complete_path;
+	GList* langlist;
+	gchar dirtemp[1024]; /* no reliable way to avoid magic # here */
 
 	gok_log_enter();
-	gok_log ("directory: %s", directory);
 	pKeyboardFirst = NULL;
 	pKeyboard = NULL;
 	pKeyboardPrevious = NULL;
+	langlist == NULL;
+	pDirectoryKeyboards = NULL;
+
+	/* find the locale specific keyboards */
+	langlist = (GList*) gnome_i18n_get_language_list(NULL);
+	if (langlist != NULL) {
+		gint i = 0;
+		guint l = g_list_length(langlist);
+		while ((pDirectoryKeyboards == NULL) && (i < l)) {
+			strncpy(dirtemp, directory, 950);
+			strncat(dirtemp, G_DIR_SEPARATOR_S, 1);
+			strncat(dirtemp, g_list_nth_data(langlist, i),70);
+			pDirectoryKeyboards = opendir (dirtemp);
+			i++;
+		}
+		g_list_free(langlist);
+	}
+
+	if (pDirectoryKeyboards == NULL) { /* no locale specific directory found */
+		pDirectoryKeyboards = opendir (directory); /* use default */
+	}
+	else {
+		directory = dirtemp; /* used later */
+	}
+		
 
 	/* get a list of all the files from the given directory name */
-	/* first, open the keyboard directory */
-	pDirectoryKeyboards = opendir (directory);
 	if (pDirectoryKeyboards == NULL)
 	{
 		gok_log_x ("Can't open keyboard directory in gok_main_read_files!");
