Index: plugins/webdav-account-setup/webdav-contacts-source.c
===================================================================
--- plugins/webdav-account-setup/webdav-contacts-source.c	(revision 37116)
+++ plugins/webdav-account-setup/webdav-contacts-source.c	(working copy)
@@ -54,6 +54,28 @@ plugin_webdav_contacts(EPlugin *epl, ECo
 int
 e_plugin_lib_enable(EPluginLib *ep, int enable);
 
+static ESourceGroup *
+find_webdav_group (ESourceList *slist)
+{
+	GSList *groups, *g;
+	ESourceGroup *group = NULL;
+
+	g_return_val_if_fail (slist != NULL, NULL);
+
+	groups = e_source_list_peek_groups (slist);
+	for (g = groups; g; g = g->next) {
+		group = E_SOURCE_GROUP (g->data);
+
+		if (group && e_source_group_peek_base_uri (group) &&
+		    g_ascii_strncasecmp (BASE_URI, e_source_group_peek_base_uri (group), strlen (BASE_URI)) == 0)
+			break;
+
+		group = NULL;
+	}
+
+	return group;
+}
+
 static void
 ensure_webdav_contacts_source_group(void)
 {
@@ -66,7 +88,7 @@ ensure_webdav_contacts_source_group(void
 		return;
 	}
 
-	group = e_source_list_peek_group_by_name(source_list, _("WebDAV"));
+	group = find_webdav_group (source_list);
 
 	if (group == NULL) {
 		gboolean res;
@@ -81,7 +103,10 @@ ensure_webdav_contacts_source_group(void
 		}
 
 		g_object_unref(group);
+	} else {
+		e_source_group_set_name (group, _("WebDAV"));
 	}
+
 	g_object_unref(source_list);
 }
 
@@ -97,7 +122,7 @@ remove_webdav_contacts_source_group(void
 		return;
 	}
 
-	group = e_source_list_peek_group_by_name(source_list, _("WebDAV"));
+	group = find_webdav_group (source_list);
 
 	if (group) {
 		GSList *sources;
Index: plugins/webdav-account-setup/ChangeLog
===================================================================
--- plugins/webdav-account-setup/ChangeLog	(revision 37116)
+++ plugins/webdav-account-setup/ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2009-01-22  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #539467
+
+	* webdav-contacts-source.c: (find_webdav_group),
+	(ensure_webdav_contacts_source_group),
+	(remove_webdav_contacts_source_group):
+	Find group by its base uri, not by a localized name.
+
 2008-09-24  Philip Withnall  <philip@tecnocode.co.uk>
 
 	** Fixes bug #553479
Index: plugins/google-account-setup/ChangeLog
===================================================================
--- plugins/google-account-setup/ChangeLog	(revision 37116)
+++ plugins/google-account-setup/ChangeLog	(working copy)
@@ -1,3 +1,14 @@
+2009-01-22  Milan Crha  <mcrha@redhat.com>
+
+	** Fix for bug #539467
+
+	* google-contacts-source.h: (manage_google_group):
+	* google-contacts-source.c: (manage_google_group),
+	(ensure_google_contacts_source_group),
+	(remove_google_contacts_source_group):
+	* google-source.c: (ensure_google_source_group):
+	Find group by its base uri, not by a localized name.
+
 2008-11-07  Matthew Barnes  <mbarnes@redhat.com>
 
 	** Fix for bug #559518
Index: plugins/google-account-setup/google-contacts-source.c
===================================================================
--- plugins/google-account-setup/google-contacts-source.c	(revision 37116)
+++ plugins/google-account-setup/google-contacts-source.c	(working copy)
@@ -37,36 +37,64 @@
 
 #include "google-contacts-source.h"
 
-
-void
-ensure_google_contacts_source_group (void)
+/**
+ * manage_google_group:
+ * Searches for a 'Google' source group and ensures it has the correct
+ * name. If only_return is set to true, then only returns found group.
+ * Otherwise returns NULL.
+ **/
+ESourceGroup *
+manage_google_group (ESourceList *slist, gboolean only_return)
 {
-    ESourceList  *source_list;
-    ESourceGroup *group;
+	GSList *groups, *g;
+	ESourceGroup *group = NULL;
 
-    source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources");
+	g_return_val_if_fail (slist != NULL, NULL);
 
-    if (source_list == NULL) {
-        return;
-    }
+	groups = e_source_list_peek_groups (slist);
+	for (g = groups; g; g = g->next) {
+		group = E_SOURCE_GROUP (g->data);
 
-    group = e_source_list_peek_group_by_name (source_list, _("Google"));
+		if (group && e_source_group_peek_base_uri (group) &&
+		    g_ascii_strncasecmp ("google://", e_source_group_peek_base_uri (group), 9) == 0)
+			break;
 
-    if (group == NULL) {
-        gboolean res;
+		group = NULL;
+	}
 
-        group = e_source_group_new (_("Google"), "google://");
-        res = e_source_list_add_group (source_list, group, -1);
+	if (only_return)
+		return group;
 
-        if (res == FALSE) {
-            g_warning ("Could not add Google source group!");
-        } else {
-            e_source_list_sync (source_list, NULL);
-        }
+	if (group) {
+		e_source_group_set_name (group, _("Google"));
+	} else {
+		group = e_source_group_new (_("Google"), "google://");
 
-        g_object_unref (group);
-    }
-    g_object_unref (source_list);
+		if (!e_source_list_add_group (slist, group, -1)) {
+			g_warning ("Could not add Google source group!");
+		} else {
+			e_source_list_sync (slist, NULL);
+		}
+
+		g_object_unref (group);
+	}
+
+	return NULL;
+}
+
+void
+ensure_google_contacts_source_group (void)
+{
+	ESourceList  *source_list;
+
+	source_list = e_source_list_new_for_gconf_default ("/apps/evolution/addressbook/sources");
+
+	if (source_list == NULL) {
+		return;
+	}
+
+	manage_google_group (source_list, FALSE);
+	g_object_unref (source_list);
 }
 
 void
@@ -81,7 +109,7 @@ remove_google_contacts_source_group (voi
         return;
     }
 
-    group = e_source_list_peek_group_by_name (source_list, _("Google"));
+    group = manage_google_group (source_list, TRUE);
 
     if (group) {
         GSList *sources;
Index: plugins/google-account-setup/google-source.c
===================================================================
--- plugins/google-account-setup/google-source.c	(revision 37116)
+++ plugins/google-account-setup/google-source.c	(working copy)
@@ -69,36 +69,17 @@ GtkWidget *      plugin_google          
 
 
 static void
-ensure_google_source_group ()
+ensure_google_source_group (void)
 {
 	ESourceList  *slist;
-	ESourceGroup *group;
-
 
 	if (!e_cal_get_sources (&slist, E_CAL_SOURCE_TYPE_EVENT, NULL)) {
 		g_warning ("Could not get calendar source list from GConf!");
 		return;
 	}
 
-	group = e_source_list_peek_group_by_name (slist, _("Google"));
-
-	if (group == NULL)
-		 g_message ("\n Google Group Not found ");
-
-	if (group == NULL) {
-		gboolean res;
-		group = e_source_group_new (_("Google"), "Google://");
-		res = e_source_list_add_group (slist, group, -1);
-
-		if (res == FALSE) {
-			g_warning ("Could not add Google source group!");
-		} else {
-			e_source_list_sync (slist, NULL);
-		}
-
-		g_object_unref (group);
-		g_object_unref (slist);
-	}
+	manage_google_group (slist, FALSE);
+	g_object_unref (slist);
 }
 
 int
Index: plugins/google-account-setup/google-contacts-source.h
===================================================================
--- plugins/google-account-setup/google-contacts-source.h	(revision 37116)
+++ plugins/google-account-setup/google-contacts-source.h	(working copy)
@@ -28,4 +28,6 @@ void       ensure_google_contacts_source
 
 void       remove_google_contacts_source_group (void);
 
+ESourceGroup *manage_google_group (ESourceList *slist, gboolean only_return);
+
 #endif
