--- filter/filter-datespec.c.~1.33.~	Sat Jan 10 02:37:13 2004
+++ filter/filter-datespec.c	Thu Mar 11 21:47:13 2004
@@ -56,19 +56,17 @@
 
 typedef struct _timespan {
 	guint32 seconds;
-	const char *singular;
-	const char *plural;
 	float max;
 } timespan;
 
 static const timespan timespans[] = {
-	{ 1, N_("1 second ago"), N_("%d seconds ago"), 59.0 },
-	{ 60, N_("1 minute ago"), N_("%d minutes ago"), 59.0 },
-	{ 3600, N_("1 hour ago"), N_("%d hours ago"), 23.0 },
-	{ 86400, N_("1 day ago"), N_("%d days ago"), 31.0 },
-	{ 604800, N_("1 week ago"), N_("%d weeks ago"), 52.0 },
-	{ 2419200, N_("1 month ago"), N_("%d months ago"), 12.0 },
-	{ 31557600, N_("1 year ago"), N_("%d years ago"), 1000.0 },
+	{ 1, 59.0 },
+	{ 60, 59.0 },
+	{ 3600, 23.0 },
+	{ 86400, 31.0 },
+	{ 604800, 52.0 },
+	{ 2419200, 12.0 },
+	{ 31557600, 1000.0 },
 };
 
 #define DAY_INDEX 3
@@ -250,6 +248,26 @@
 	return 0;
 }
 
+char *
+get_string_for_span (int span, int count)
+{
+	switch (span) {
+	case 0:
+		return g_strdup_printf(ngettext("%d second ago", "%d seconds ago", count));
+	case 1:
+		return g_strdup_printf(ngettext("%d minute ago", "%d minutes ago", count));
+	case 2:
+		return g_strdup_printf(ngettext("%d hour ago", "%d hours ago", count));
+	case 3:
+		return g_strdup_printf(ngettext("%d day ago", "%d days ago", count));
+	case 4:
+		return g_strdup_printf(ngettext("%d month ago", "%d months ago", count));
+	case 5:
+		return g_strdup_printf(ngettext("%d year ago", "%d years ago", count));
+	}
+	return NULL;
+}
+
 static int
 get_best_span (time_t val)
 {
@@ -289,16 +307,13 @@
 			label = _("now");
 		else {
 			int span, count;
+			char *string;
 			
 			span = get_best_span(fds->value);
 			count = fds->value / timespans[span].seconds;
-			
-			if (count == 1)
-				/* 1 (minute|day|...) ago (singular time ago) */
-				strcpy(buf, _(timespans[span].singular));
-			else
-				/* N (minutes|days|...) ago (plural time ago) */
-				sprintf(buf, _(timespans[span].plural), count);
+			string = get_string_for_span (span, count);
+			strcpy(buf, string);
+			g_free(string);
 		}
 		break;
 	}
