summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZenWalker <[email protected]>2017-09-09 20:20:41 +0200
committerZenWalker <[email protected]>2017-09-09 20:20:41 +0200
commit92e73b9d3d2fccd6f6c3f3f719f0fbee18a1ed11 (patch)
tree8bbf553dc76061a5697cd2c4c1928fd1d2ce8ed5
parent52df89dc6ce7c3c58dcac6b781b8ff540336fce8 (diff)
downloadmate-screensaver-92e73b9d3d2fccd6f6c3f3f719f0fbee18a1ed11.tar.bz2
mate-screensaver-92e73b9d3d2fccd6f6c3f3f719f0fbee18a1ed11.tar.xz
Fix: idle slider display in all languages
-rw-r--r--src/mate-screensaver-preferences.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/mate-screensaver-preferences.c b/src/mate-screensaver-preferences.c
index f48a369..7f63430 100644
--- a/src/mate-screensaver-preferences.c
+++ b/src/mate-screensaver-preferences.c
@@ -942,7 +942,7 @@ time_to_string_text (long time)
char *secs, *mins, *hours, *string;
int sec, min, hour;
- int inc_len, len_hour, len_minutes;
+ int inc_len, len_minutes;
sec = time % 60;
time = time - sec;
@@ -965,9 +965,6 @@ time_to_string_text (long time)
g_strdup_printf (ngettext ("%d minute",
"%d minutes", 59), 59))) - 1;
- len_hour = strlen (g_strdup_printf (ngettext ("%d hour",
- "%d hours", 1), 1));
-
len_minutes = 0;
for (int n = 2; n < 60; n++)
@@ -990,6 +987,15 @@ time_to_string_text (long time)
}
}
+ if ((strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
+ "%d minutes", 1), 1), NULL)) - 2) > len_minutes)
+
+ len_minutes = strlen (g_str_to_ascii (g_strdup_printf (ngettext ("%d minute",
+ "%d minutes", 1), 1), NULL)) - 2;
+
+ if (len_minutes < 1)
+ len_minutes = 1;
+
if (hour > 0)
{
if (sec > 0)
@@ -1023,7 +1029,7 @@ time_to_string_text (long time)
if (min < 10)
{
if (min == 1)
- while (strlen (string) != (2 * len_hour + inc_len - 4))
+ while (strlen (string) != (len_minutes + inc_len + 3))
{
if (strlen (string) % 2 == 0)
string = g_strconcat (string, " ", NULL);