[Xfce4-commits] <xfce4-time-out-plugin:master> Fix plurals when seconds are not displayed
Landry Breuil
noreply at xfce.org
Tue Apr 17 12:48:02 CEST 2012
Updating branch refs/heads/master
to ff8a995c91775b9af470c87a80fd45e23c0bc5e2 (commit)
from 6d306171ebe6a4aec328c5e161578c4afad0a67b (commit)
commit ff8a995c91775b9af470c87a80fd45e23c0bc5e2
Author: Landry Breuil <landry at xfce.org>
Date: Tue Apr 17 12:46:17 2012 +0200
Fix plurals when seconds are not displayed
Avoids getting "2 minute"..
panel-plugin/time-out-countdown.c | 21 +++------------------
1 files changed, 3 insertions(+), 18 deletions(-)
diff --git a/panel-plugin/time-out-countdown.c b/panel-plugin/time-out-countdown.c
index d3b48bb..8a142bf 100644
--- a/panel-plugin/time-out-countdown.c
+++ b/panel-plugin/time-out-countdown.c
@@ -472,28 +472,18 @@ time_out_countdown_seconds_to_string (gint seconds,
{
if (hours <= 0)
{
- if (minutes < 1)
- {
- /* Do not show 0 minutes */
- minutes = 1;
- }
if (seconds == 0)
g_string_printf (str, _("Time left: %s"), mins);
else
{
/* Round up the number of minutes */
g_free (mins);
- mins = g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes), minutes + 1);
+ mins = g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes + 1), minutes + 1);
g_string_printf (str, _("Time left: %s"), mins);
}
}
else
{
- if (minutes < 1)
- {
- /* Do not show 0 minutes */
- minutes = 1;
- }
if (seconds == 0)
/* Translators: this is %s hours, %s minutes */
g_string_printf (str, _("Time left: %s %s"), hrs, mins);
@@ -501,7 +491,7 @@ time_out_countdown_seconds_to_string (gint seconds,
{
/* Round up the number of minutes */
g_free (mins);
- mins = g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes), minutes + 1);
+ mins = g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes + 1), minutes + 1);
/* Translators: this is %s hours, %s minutes */
g_string_printf (str, _("Time left: %s %s"), hrs, mins);
}
@@ -529,18 +519,13 @@ time_out_countdown_seconds_to_string (gint seconds,
}
else
{
- if (minutes < 1)
- {
- /* Do not show 0 minutes */
- minutes = 1;
- }
if (seconds == 0)
g_string_printf (str, _("Time left: %s"), mins);
else
{
/* Round up the number of minutes */
g_free (mins);
- mins = g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes), minutes + 1);
+ mins = g_strdup_printf (ngettext ("%d minute", "%d minutes", minutes + 1), minutes + 1);
g_string_printf (str, _("Time left: %s"), mins);
}
}
More information about the Xfce4-commits
mailing list