Index: plugins/calendar-weather/calendar-weather.c
===================================================================
--- plugins/calendar-weather/calendar-weather.c	(revision 33892)
+++ plugins/calendar-weather/calendar-weather.c	(working copy)
@@ -41,31 +41,48 @@
 
 static GtkTreeStore *store = NULL;
 
+static struct {
+	const gchar *category;
+	const gchar *icon_file;
+} weather_types [] = {
+	{N_("Weather: Cloudy"), WEATHER_DATADIR "/category_weather_cloudy_16.png"},
+	{N_("Weather: Fog"), WEATHER_DATADIR "/category_weather_fog_16.png"},
+	{N_("Weather: Partly Cloudy"), WEATHER_DATADIR "/category_weather_partly_cloudy_16.png"},
+	{N_("Weather: Rain"), WEATHER_DATADIR "/category_weather_rain_16.png"},
+	{N_("Weather: Snow"), WEATHER_DATADIR "/category_weather_snow_16.png"},
+	{N_("Weather: Sunny"), WEATHER_DATADIR "/category_weather_sun_16.png"},
+	{N_("Weather: Thunderstorms"), WEATHER_DATADIR "/category_weather_tstorm_16.png"}
+};
+
+static guint num_weather_types = G_N_ELEMENTS (weather_types);
+
 #define WEATHER_BASE_URI "weather://"
 
 int
 e_plugin_lib_enable (EPluginLib *epl, int enable)
 {
-	GList *l;
-	gboolean found = FALSE;
+	GList *l, *categories;
+	gint i;
 
+	categories = e_categories_get_list ();
 	/* Add the categories icons if we don't have them. */
-	for (l = e_categories_get_list (); l; l = g_list_next (l)) {
-		if (!strcmp ((const char *)l->data, _("Weather: Cloudy"))) {
-			found = TRUE;
-			break;
+	for (i = 0; i < num_weather_types; i++) {
+		gboolean found = FALSE;
+		for (l = categories; l; l = g_list_next (l)) {
+			if (!strcmp ((const char *)l->data, gettext (weather_types[i].category))) {
+				found = TRUE;
+				break;
+			}
 		}
+		if (!found) {
+			e_categories_add (gettext (weather_types[i].category), NULL,
+					  weather_types[i].icon_file, FALSE);
+		}
 	}
-	if (!found) {
-		e_categories_add (_("Weather: Cloudy"), NULL, WEATHER_DATADIR "/category_weather_cloudy_16.png", FALSE);
-		e_categories_add (_("Weather: Fog"), NULL, WEATHER_DATADIR "/category_weather_fog_16.png", FALSE);
-		e_categories_add (_("Weather: Partly Cloudy"), NULL, WEATHER_DATADIR "/category_weather_partly_cloudy_16.png", FALSE);
-		e_categories_add (_("Weather: Rain"), NULL, WEATHER_DATADIR "/category_weather_rain_16.png", FALSE);
-		e_categories_add (_("Weather: Snow"), NULL, WEATHER_DATADIR "/category_weather_snow_16.png", FALSE);
-		e_categories_add (_("Weather: Sunny"), NULL, WEATHER_DATADIR "/category_weather_sun_16.png", FALSE);
-		e_categories_add (_("Weather: Thunderstorms"), NULL, WEATHER_DATADIR "/category_weather_tstorm_16.png", FALSE);
-	}
 
+	if (categories)
+		g_list_free (categories);
+
 	return 0;
 }
 
