nautilus r14923 - in trunk: . libnautilus-private



Author: awalton
Date: Sat Feb  7 04:40:37 2009
New Revision: 14923
URL: http://svn.gnome.org/viewvc/nautilus?rev=14923&view=rev

Log:
2009-02-06  A. Walton  <awalton gnome org>

	* libnautilus-private/nautilus-link.c (get_language),
	(nautilus_link_local_set_key):
	Pass a language code to g_key_file_set_locale_string() so that we can
	actually rename .desktop files.



Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-link.c

Modified: trunk/libnautilus-private/nautilus-link.c
==============================================================================
--- trunk/libnautilus-private/nautilus-link.c	(original)
+++ trunk/libnautilus-private/nautilus-link.c	Sat Feb  7 04:40:37 2009
@@ -293,6 +293,22 @@
 	return TRUE;
 }
 
+static const char *
+get_language (void)
+{
+	const char * const *langs_pointer;
+	int i;
+
+	langs_pointer = g_get_language_names ();
+	for (i = 0; langs_pointer[i] != NULL; i++) {
+		/* find first without encoding */
+		if (strchr (langs_pointer[i], '.') == NULL) {
+		return langs_pointer[i];
+		}
+	}
+	return NULL;
+} 
+
 static gboolean
 nautilus_link_local_set_key (const char *uri,
 			     const char *key,
@@ -313,7 +329,8 @@
 	g_key_file_set_locale_string (key_file,
 				      MAIN_GROUP,
 				      key,
-				      NULL, value);
+				      get_language (), 
+				      value);
 	
 	
 	success = _g_key_file_save_to_gfile (key_file,  file, NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]