From c513fa00157069e0ba6b4015ad2d6f8aa56b9190 Mon Sep 17 00:00:00 2001 From: Sushma Rai Date: Mon, 9 May 2005 11:33:31 +0000 Subject: Removed the plural form "contact(s)" from translatable error message. Fixes #261969. svn path=/trunk/; revision=29318 --- addressbook/gui/widgets/eab-gui-util.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'addressbook/gui') diff --git a/addressbook/gui/widgets/eab-gui-util.c b/addressbook/gui/widgets/eab-gui-util.c index a6c4517cb1..5fd8feb0d7 100644 --- a/addressbook/gui/widgets/eab-gui-util.c +++ b/addressbook/gui/widgets/eab-gui-util.c @@ -323,6 +323,7 @@ file_exists(GtkWindow *window, const char *filename) typedef struct { GtkWidget *filesel; char *vcard; + gboolean has_multiple_contacts; } SaveAsInfo; static void @@ -351,7 +352,23 @@ save_it(GtkWidget *widget, SaveAsInfo *info) return; } } else if (error != 0) { - e_error_run (GTK_WINDOW (info->filesel), "addressbook:save-error", filename, g_strerror (errno)); + char *err_str_ext; + if (info->has_multiple_contacts) { + /* more than one, finding the total number of contacts might + * hit performance while saving large number of contacts + */ + err_str_ext = ngettext ("contact", "contacts", 2); + } + else { + err_str_ext = ngettext ("contact", "contacts", 1); + } + + /* translators: Arguments, err_str_ext (item to be saved: "contact"/"contacts"), + * destination file name, and error code will fill the placeholders + * {0}, {1} and {2}, respectively in the error message formed + */ + e_error_run (GTK_WINDOW (info->filesel), "addressbook:save-error", + err_str_ext, filename, g_strerror (errno)); return; } @@ -479,6 +496,8 @@ eab_contact_save (char *title, EContact *contact, GtkWindow *parent_window) name = e_contact_get (contact, E_CONTACT_FILE_AS); file = make_safe_filename (name); + info->has_multiple_contacts = FALSE; + #ifdef USE_GTKFILECHOOSER filesel = gtk_file_chooser_dialog_new (title, parent_window, @@ -543,6 +562,12 @@ eab_contact_list_save (char *title, GList *list, GtkWindow *parent_window) filesel = gtk_file_selection_new(title); #endif + /* Check if the list has more than one contact */ + if (g_list_next (list)) + info->has_multiple_contacts = TRUE; + else + info->has_multiple_contacts = FALSE; + /* This is a filename. Translators take note. */ if (list && list->data && list->next == NULL) { char *name; -- cgit v1.2.3