From 0ed3e1762249d7c1ab954e7fa16543bb16d58f60 Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 6 Jun 2023 16:34:09 +0200 Subject: src/device.c: Don't show parentheses around time-remaining / battery charge percentage values when in Lomiri. --- src/device.c | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/device.c b/src/device.c index 6e79557..af01253 100644 --- a/src/device.c +++ b/src/device.c @@ -27,6 +27,7 @@ License along with this library. If not, see #include "config.h" #endif +#include #include #include @@ -1063,18 +1064,42 @@ indicator_power_device_get_readable_title (const IndicatorPowerDevice * device, if (want_time && want_percent) { - /* TRANSLATORS: after the icon, a time-remaining string + battery %. Example: "(0:59, 33%)" */ - str = g_strdup_printf (_("(%s, %.0lf%%)"), time_str, p->percentage); + /* Don't show parentheses around text values in Lomiri */ + if (ayatana_common_utils_is_lomiri()) + { + /* TRANSLATORS: after the icon, a time-remaining string + battery %. Example: "0:59 33%" */ + str = g_strdup_printf (_("%s %.0lf%%"), time_str, p->percentage); + } + else { + /* TRANSLATORS: after the icon, a time-remaining string + battery %. Example: "(0:59, 33%)" */ + str = g_strdup_printf (_("(%s, %.0lf%%)"), time_str, p->percentage); + } } else if (want_time) { - /* TRANSLATORS: after the icon, a time-remaining string Example: "(0:59)" */ - str = g_strdup_printf (_("(%s)"), time_str); + /* Don't show parentheses around text values in Lomiri */ + if (ayatana_common_utils_is_lomiri()) + { + /* TRANSLATORS: after the icon, a time-remaining string Example: "0:59" */ + str = g_strdup_printf (_("%s"), time_str); + } + else { + /* TRANSLATORS: after the icon, a time-remaining string Example: "(0:59)" */ + str = g_strdup_printf (_("(%s)"), time_str); + } } else if (want_percent) { - /* TRANSLATORS: after the icon, a battery %. Example: "(33%)" */ - str = g_strdup_printf (_("(%.0lf%%)"), p->percentage); + /* Don't show parentheses around text values in Lomiri */ + if (ayatana_common_utils_is_lomiri()) + { + /* TRANSLATORS: after the icon, a battery %. Example: "(33%)" */ + str = g_strdup_printf (_("%.0lf%%"), p->percentage); + } + else { + /* TRANSLATORS: after the icon, a battery %. Example: "(33%)" */ + str = g_strdup_printf (_("(%.0lf%%)"), p->percentage); + } } else { -- cgit v1.2.3