diff options
author | Sivaiah Nallagatla <snallagatla@novell.com> | 2005-01-28 18:28:43 +0800 |
---|---|---|
committer | Sivaiah Nallagatla <siva@src.gnome.org> | 2005-01-28 18:28:43 +0800 |
commit | 9a9f6fee40e52421e6a63ca8be67c8ecdc2f685e (patch) | |
tree | 8a4c6ba9ab424a6a59ef969019ef37abaa48887c | |
parent | d8d4d75931e895d23884e94bc2b06efe571b0d39 (diff) | |
download | gsoc2013-evolution-9a9f6fee40e52421e6a63ca8be67c8ecdc2f685e.tar.gz gsoc2013-evolution-9a9f6fee40e52421e6a63ca8be67c8ecdc2f685e.tar.zst gsoc2013-evolution-9a9f6fee40e52421e6a63ca8be67c8ecdc2f685e.zip |
use ngetext instead of splitting the the sentence to take care of
2005-01-28 Sivaiah Nallagatla <snallagatla@novell.com>
* addressbook/ea-minicard-view.c
(ea_minicard_view_get_name) : use ngetext
instead of splitting the the sentence to take care
of different messages for plural vs singular case
Fixes #61060
svn path=/trunk/; revision=28596
-rw-r--r-- | a11y/ChangeLog | 8 | ||||
-rw-r--r-- | a11y/addressbook/ea-minicard-view.c | 22 |
2 files changed, 16 insertions, 14 deletions
diff --git a/a11y/ChangeLog b/a11y/ChangeLog index 507ce171ed..77113f88ad 100644 --- a/a11y/ChangeLog +++ b/a11y/ChangeLog @@ -1,3 +1,11 @@ +2005-01-28 Sivaiah Nallagatla <snallagatla@novell.com> + + * addressbook/ea-minicard-view.c + (ea_minicard_view_get_name) : use ngetext + instead of splitting the the sentence to take care + of different messages for plural vs singular case + Fixes #61060 + 2005-01-15 JP Rosevear <jpr@novell.com> * calendar/ea-calendar-helpers.c diff --git a/a11y/addressbook/ea-minicard-view.c b/a11y/addressbook/ea-minicard-view.c index e6c499983a..fa40d70113 100644 --- a/a11y/addressbook/ea-minicard-view.c +++ b/a11y/addressbook/ea-minicard-view.c @@ -139,26 +139,20 @@ ea_minicard_view_class_init (EaMinicardViewClass *klass) static G_CONST_RETURN gchar* ea_minicard_view_get_name (AtkObject *accessible) { - gchar name[100]; - GString *new_str = g_string_new (NULL); - gchar str[10]; EReflow *reflow; - + gchar *string; + g_return_val_if_fail (EA_IS_MINICARD_VIEW (accessible), NULL); - memset (name, '\0', 100); - memset (str, '\0', 10); reflow = E_REFLOW(atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible))); - sprintf (str, "%d", reflow->count); - g_string_append (new_str, _("current addressbook folder ")); - g_string_append (new_str, (reflow->count) > 1 ? _("have ") : _("has ")); - g_string_append (new_str, str); - g_string_append (new_str, (reflow->count) > 1 ? _(" cards") : _(" card")); - strcpy (name, new_str->str); - g_string_free (new_str, TRUE); + string = g_strdup_printf (ngettext ("current addressbook folder has %d card", + "current addressbook folder have %d cards", + reflow->count), reflow->count); + - ATK_OBJECT_CLASS (parent_class)->set_name (accessible, name); + ATK_OBJECT_CLASS (parent_class)->set_name (accessible, string); + g_free (string); return accessible->name; } |