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/ChangeLog | 12 ++++++++++++ addressbook/addressbook-errors.xml | 4 ++-- addressbook/gui/widgets/eab-gui-util.c | 27 ++++++++++++++++++++++++++- 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 71828bc8a8..bde060a742 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,15 @@ +2005-05-09 Sushma Rai + + * gui/widgets/eab-gui-util.c (eab_contact_save)(eab_contact_list_save): + Finding if multiple contacts or a single contact has been selected for + saving, and storing it in SaveAsInfo structure. + (save_it): Depending on selected contacts, forming a part of error + message. + + * addressbook-errors.xml: Changed the save-error message, to read + string contact/contacts. + Fixes #261969. + 2005-05-09 Sushma Rai * gui/widgets/e-addressbook-view.c (eab_view_delete_selection): Checking diff --git a/addressbook/addressbook-errors.xml b/addressbook/addressbook-errors.xml index 0d6b331b28..fbcc3a0d78 100644 --- a/addressbook/addressbook-errors.xml +++ b/addressbook/addressbook-errors.xml @@ -75,8 +75,8 @@ - Unable to save contact(s). - Error saving contacts to {0}: {1} + Unable to save {0}. + Error saving {0} to {1}: {2} 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