Index: ve-misc.h
===================================================================
--- ve-misc.h	(revision 256)
+++ ve-misc.h	(working copy)
@@ -92,10 +92,6 @@ void ve_unsetenv (const char *name);
 #endif
 void ve_clearenv (void);
 
-/* just like gnome_i18n_get_language_list (in fact if you link to
-   gnome it uses that */
-const GList * ve_i18n_get_language_list (const gchar *category_name);
-
 char * ve_find_prog_in_path (const char *prog, const char *path);
 gboolean ve_is_prog_in_path (const char *prog, const char *path);
 
Index: ve-config.c
===================================================================
--- ve-config.c	(revision 256)
+++ ve-config.c	(working copy)
@@ -642,11 +642,12 @@ char *
 ve_config_get_translated_string (VeConfig *config,
 				 const char *key)
 {
-	const GList *li;
+	const char * const *langs;
 	char *dkey;
 	char *def;
 	VeLine *line = NULL;
 	char *ret;
+	int i;
 
 	g_return_val_if_fail (config != NULL, NULL);
 	g_return_val_if_fail (key != NULL, NULL);
@@ -658,10 +659,10 @@ ve_config_get_translated_string (VeConfi
 		def++;
 	}
 
-	for (li = ve_i18n_get_language_list ("LC_MESSAGES");
-	     li != NULL;
-	     li = li->next) {
-		char *full = g_strdup_printf ("%s[%s]", dkey, (char *)li->data);
+	langs = g_get_language_names ();
+
+	for (i = 0; langs[i] != NULL; i++) {
+		char *full = g_strdup_printf ("%s[%s]", dkey, langs[i]);
 		line = g_hash_table_lookup (config->line_ht, full);
 		g_free (full);
 		if (line != NULL)
Index: ve-gnome.c
===================================================================
--- ve-gnome.c	(revision 256)
+++ ve-gnome.c	(working copy)
@@ -96,39 +96,3 @@ ve_find_file (const char *filename, cons
 	return NULL;
 }
 
-/**
- * ve_i18n_get_language_list:
- * @ignored: Not used anymore (Historically: Name of category to look
- *                 up, e.g. %"LC_MESSAGES").
- * 
- * Computes a list of applicable locale names, which can be used to e.g.
- * construct locale-dependent filenames or search paths. The returned list is
- * sorted from most desirable to least desirable and always contains the
- * default locale "C".
- * 
- * Return value: the list of languages, this list should not be freed as it is
- * owned by ve.
- **/
-const GList *
-ve_i18n_get_language_list (const gchar *category_name)
-{
-	static GStaticRecMutex lang_list_lock = G_STATIC_REC_MUTEX_INIT;
-	static GList *list = NULL;
-	const char * const* langs;
-	int i;
-
-	g_static_rec_mutex_lock (&lang_list_lock);
-
-	if (list == NULL) {
-		langs = g_get_language_names ();
-		for (i = 0; langs[i] != NULL; i++) {
-			list = g_list_prepend (list, g_strdup(langs[i]));
-		}
-
-		list = g_list_reverse (list);
-	}
-
-	g_static_rec_mutex_unlock (&lang_list_lock);
-
-	return list;
-}
Index: ve-nongnome.c
===================================================================
--- ve-nongnome.c	(revision 256)
+++ ve-nongnome.c	(working copy)
@@ -75,309 +75,3 @@ ve_find_file (const char *filename, cons
 	return NULL;
 }
 
-/* Following stolen from libgnome / gnome-i18n.c */
-
-static GHashTable *alias_table = NULL;
-
-/*read an alias file for the locales*/
-static void
-read_aliases (char *file)
-{
-  FILE *fp;
-  char buf[256];
-  if (!alias_table)
-    alias_table = g_hash_table_new (g_str_hash, g_str_equal);
-  VE_IGNORE_EINTR (fp = fopen (file,"r"));
-  if (!fp)
-    return;
-  for (;;)
-    {
-      char *p;
-      VE_IGNORE_EINTR (p = fgets (buf, sizeof (buf), fp));
-      if (p == NULL)
-	      break;
-      g_strstrip(buf);
-      if (buf[0]=='#' || buf[0]=='\0')
-        continue;
-      p = strtok (buf,"\t ");
-      if (!p)
-	continue;
-      p = strtok (NULL,"\t ");
-      if(!p)
-	continue;
-      if (!g_hash_table_lookup (alias_table, buf))
-	g_hash_table_insert (alias_table, g_strdup(buf), g_strdup(p));
-    }
-  VE_IGNORE_EINTR (fclose (fp));
-}
-
-/*return the un-aliased language as a newly allocated string*/
-static char *
-unalias_lang (char *lang)
-{
-  char *p;
-  int i;
-  if (!alias_table)
-    {
-      read_aliases ("/usr/share/locale/locale.alias");
-      read_aliases ("/usr/local/share/locale/locale.alias");
-      read_aliases ("/usr/lib/X11/locale/locale.alias");
-      read_aliases ("/usr/openwin/lib/locale/locale.alias");
-    }
-  i = 0;
-  while ((p=g_hash_table_lookup(alias_table,lang)) && strcmp(p, lang))
-    {
-      lang = p;
-      if (i++ == 30)
-        {
-          static gboolean said_before = FALSE;
-	  if (!said_before)
-            g_warning (_("Too many alias levels for a locale; "
-			 "may indicate a loop"));
-	  said_before = TRUE;
-	  return lang;
-	}
-    }
-  return lang;
-}
-
-/* Mask for components of locale spec. The ordering here is from
- * least significant to most significant
- */
-enum
-{
-  COMPONENT_CODESET =   1 << 0,
-  COMPONENT_TERRITORY = 1 << 1,
-  COMPONENT_MODIFIER =  1 << 2
-};
-
-/* Break an X/Open style locale specification into components
- */
-static guint
-explode_locale (const gchar *locale,
-		gchar **language, 
-		gchar **territory, 
-		gchar **codeset, 
-		gchar **modifier)
-{
-  const gchar *uscore_pos;
-  const gchar *at_pos;
-  const gchar *dot_pos;
-
-  guint mask = 0;
-
-  uscore_pos = strchr (locale, '_');
-  dot_pos = strchr (uscore_pos ? uscore_pos : locale, '.');
-  at_pos = strchr (dot_pos ? dot_pos : (uscore_pos ? uscore_pos : locale), '@');
-
-  if (at_pos)
-    {
-      mask |= COMPONENT_MODIFIER;
-      *modifier = g_strdup (at_pos);
-    }
-  else
-    at_pos = locale + strlen (locale);
-
-  if (dot_pos)
-    {
-      mask |= COMPONENT_CODESET;
-      *codeset = g_new (gchar, 1 + at_pos - dot_pos);
-      strncpy (*codeset, dot_pos, at_pos - dot_pos);
-      (*codeset)[at_pos - dot_pos] = '\0';
-    }
-  else
-    dot_pos = at_pos;
-
-  if (uscore_pos)
-    {
-      mask |= COMPONENT_TERRITORY;
-      *territory = g_new (gchar, 1 + dot_pos - uscore_pos);
-      strncpy (*territory, uscore_pos, dot_pos - uscore_pos);
-      (*territory)[dot_pos - uscore_pos] = '\0';
-    }
-  else
-    uscore_pos = dot_pos;
-
-  *language = g_new (gchar, 1 + uscore_pos - locale);
-  strncpy (*language, locale, uscore_pos - locale);
-  (*language)[uscore_pos - locale] = '\0';
-
-  return mask;
-}
-
-/*
- * Compute all interesting variants for a given locale name -
- * by stripping off different components of the value.
- *
- * For simplicity, we assume that the locale is in
- * X/Open format: language[_territory][.codeset][@modifier]
- *
- * TODO: Extend this to handle the CEN format (see the GNUlibc docs)
- *       as well. We could just copy the code from glibc wholesale
- *       but it is big, ugly, and complicated, so I'm reluctant
- *       to do so when this should handle 99% of the time...
- */
-static GList *
-compute_locale_variants (const gchar *locale)
-{
-  GList *retval = NULL;
-
-  gchar *language = NULL;
-  gchar *territory = NULL;
-  gchar *codeset = NULL;
-  gchar *modifier = NULL;
-
-  guint mask;
-  guint i;
-
-  g_return_val_if_fail (locale != NULL, NULL);
-
-  mask = explode_locale (locale, &language, &territory, &codeset, &modifier);
-
-  /* Iterate through all possible combinations, from least attractive
-   * to most attractive.
-   */
-  for (i=0; i<=mask; i++)
-    if ((i & ~mask) == 0)
-      {
-	gchar *val = g_strconcat(language,
-				 (i & COMPONENT_TERRITORY) ? territory : "",
-				 (i & COMPONENT_CODESET) ? codeset : "",
-				 (i & COMPONENT_MODIFIER) ? modifier : "",
-				 NULL);
-	retval = g_list_prepend (retval, val);
-      }
-
-  g_free (language);
-  if (mask & COMPONENT_CODESET)
-    g_free (codeset);
-  if (mask & COMPONENT_TERRITORY)
-    g_free (territory);
-  if (mask & COMPONENT_MODIFIER)
-    g_free (modifier);
-
-  return retval;
-}
-
-/* The following is (partly) taken from the gettext package.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.  */
-
-static const gchar *
-guess_category_value (const gchar *categoryname)
-{
-  const gchar *retval;
-
-  /* The highest priority value is the `LANGUAGE' environment
-     variable.  This is a GNU extension.  */
-  retval = g_getenv ("LANGUAGE");
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-
-  /* `LANGUAGE' is not set.  So we have to proceed with the POSIX
-     methods of looking to `LC_ALL', `LC_xxx', and `LANG'.  On some
-     systems this can be done by the `setlocale' function itself.  */
-
-  /* Setting of LC_ALL overwrites all other.  */
-  retval = g_getenv ("LC_ALL");  
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-
-  /* Next comes the name of the desired category.  */
-  retval = g_getenv (categoryname);
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-
-  /* Last possibility is the LANG environment variable.  */
-  retval = g_getenv ("LANG");
-  if (retval != NULL && retval[0] != '\0')
-    return retval;
-
-  return NULL;
-}
-
-
-static GHashTable *category_table= NULL;
-
-/**
- * ve_i18n_get_language_list:
- * @category_name: Name of category to look up, e.g. %"LC_MESSAGES".
- * 
- * This computes a list of language strings that the user wants.  It searches in
- * the standard environment variables to find the list, which is sorted in order
- * from most desirable to least desirable.  The `C' locale is appended to the
- * list if it does not already appear (other routines depend on this
- * behaviour). If @category_name is %NULL, then %LC_ALL is assumed.
- *
- * This function and all the related above code stolen from libgnome and thus
- * copyrighted as:
- *  Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
- *  All rights reserved.
- * 
- * Return value: the list of languages, this list should not be freed as it is
- * owned by vicious-extensions
- **/
-const GList *
-ve_i18n_get_language_list (const gchar *category_name)
-{
-  GList *list;
-
-  if (!category_name)
-    category_name= "LC_ALL";
-
-  if (category_table)
-    {
-      list= g_hash_table_lookup (category_table, (const gpointer) category_name);
-    }
-  else
-    {
-      category_table= g_hash_table_new (g_str_hash, g_str_equal);
-      list= NULL;
-    }
-
-  if (!list)
-    {
-      gint c_locale_defined= FALSE;
-  
-      const gchar *category_value;
-      gchar *category_memory, *orig_category_memory;
-
-      category_value = guess_category_value (category_name);
-      if (! category_value)
-	category_value = "C";
-      orig_category_memory = category_memory =
-	g_malloc (strlen (category_value)+1);
-      
-      while (category_value[0] != '\0')
-	{
-	  while (category_value[0] != '\0' && category_value[0] == ':')
-	    ++category_value;
-	  
-	  if (category_value[0] != '\0')
-	    {
-	      char *cp= category_memory;
-	      
-	      while (category_value[0] != '\0' && category_value[0] != ':')
-		*category_memory++= *category_value++;
-	      
-	      category_memory[0]= '\0'; 
-	      category_memory++;
-	      
-	      cp = unalias_lang(cp);
-	      
-	      if (strcmp (cp, "C") == 0)
-		c_locale_defined= TRUE;
-	      
-	      list= g_list_concat (list, compute_locale_variants (cp));
-	    }
-	}
-
-      g_free (orig_category_memory);
-      
-      if (!c_locale_defined)
-	list= g_list_append (list, "C");
-
-      g_hash_table_insert (category_table, (gpointer) category_name, list);
-    }
-  
-  return list;
-}
