[epiphany] Always use i18n'd Desktop and Downloads dir names



commit 2424b7418399694e059ea22699de1c0c45dab772
Author: Diego Escalante Urrelo <descalante igalia com>
Date:   Tue Feb 23 01:47:21 2010 -0500

    Always use i18n'd Desktop and Downloads dir names
    
    Otherwise preferences gets confused and also some other parts of our code put
    files where they shouldn't be. This was causing the default downloads
    destination to reset everytime the preferences dialog was opened and also
    causing some downloads (when "Open" is selected) to end up where they
    shouldn't.
    
    Bug #610721

 lib/ephy-file-helpers.c |    3 ++-
 src/prefs-dialog.c      |    7 +++++--
 2 files changed, 7 insertions(+), 3 deletions(-)
---
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index baf8a18..adddc84 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -207,7 +207,8 @@ ephy_file_desktop_dir (void)
 	if (xdg_desktop_dir != NULL)
 		return g_strdup (xdg_desktop_dir);
 
-	return g_build_filename	(g_get_home_dir (), "Desktop", NULL);
+	/* If we don't have XDG user dirs info, return an educated guess. */
+	return g_build_filename	(g_get_home_dir (), _("Desktop"), NULL);
 }
 
 /**
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index 6545f7c..d532d41 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -906,13 +906,16 @@ download_path_changed_cb (GtkFileChooser *button)
 	desktop_dir = ephy_file_desktop_dir ();
 	g_return_if_fail (downloads_dir != NULL && desktop_dir != NULL);
 
+	/* Check if the dir matches the default downloads_dir or desktop_dir to
+	 * store the english name instead of the localized one reported by the
+	 * two ephy_file_ functions. */
 	if (strcmp (dir, downloads_dir) == 0)
 	{
-		eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, "Downloads");
+		eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, _("Downloads"));
 	}
 	else if (strcmp (dir, desktop_dir) == 0)
 	{
-		eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, "Desktop");
+		eel_gconf_set_string (CONF_STATE_DOWNLOAD_DIR, _("Desktop"));
 	}
 	else
 	{



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