[empathy] log-window: properly translate duration strings



commit 63ad9ebf15467a134ab044969faecbf3f4a2a758
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Sep 15 15:06:19 2011 +0200

    log-window: properly translate duration strings
    
    https://bugzilla.gnome.org/show_bug.cgi?id=659141

 libempathy-gtk/empathy-log-window.c |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 896462e..7c12ae2 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -1371,13 +1371,24 @@ log_window_append_call (TplEvent *event,
   if (tpl_call_event_get_end_reason (call) != TPL_CALL_END_REASON_NO_ANSWER)
     {
       gchar *body;
+      gchar *tmp;
 
       span = tpl_call_event_get_duration (TPL_CALL_EVENT (event));
+
       if (span < 60)
-        duration = g_strdup_printf (_("%" G_GINT64_FORMAT " seconds"), span);
+        {
+          tmp = g_strdup_printf ("%" G_GINT64_FORMAT, span);
+          duration = g_strdup_printf (
+              ngettext ("%s second", "%s seconds", span), tmp);
+          g_free (tmp);
+        }
       else
-        duration = g_strdup_printf (_("%" G_GINT64_FORMAT " minutes"),
-            span / 60);
+        {
+          tmp = g_strdup_printf ("%" G_GINT64_FORMAT, span / 60);
+          duration = g_strdup_printf (
+              ngettext ("%s minute", "%s minutes", span / 60), tmp);
+          g_free (tmp);
+        }
 
       finished_date = g_date_time_add (started_date, -span);
       finished = g_date_time_format (finished_date, "%X");



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]