Pass a language code to g_key_file_set_locale_string() so that we can

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.


svn path=/trunk/; revision=14923
This commit is contained in:
A. Walton 2009-02-07 04:40:37 +00:00 committed by Andrew Walton
parent 8988ae66fc
commit 27238daf92
2 changed files with 25 additions and 1 deletions

View file

@ -1,3 +1,10 @@
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.
2009-02-04 Cosimo Cecchi <cosimoc@gnome.org>
* src/nautilus-application.c: (create_window):

View file

@ -293,6 +293,22 @@ nautilus_link_local_create (const char *directory_uri,
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 @@ nautilus_link_local_set_key (const char *uri,
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);