aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-06-06 16:34:09 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-06-06 16:34:09 +0200
commit80312bd77184017a9caf682ea0cedbc658ca6604 (patch)
tree1dca4fb13032b4b4a93c55f6b124147c28a58e38
parent22d2a526e72629f0880a2b9d681dcf133f466188 (diff)
downloadayatana-indicator-power-80312bd77184017a9caf682ea0cedbc658ca6604.tar.gz
ayatana-indicator-power-80312bd77184017a9caf682ea0cedbc658ca6604.tar.bz2
ayatana-indicator-power-80312bd77184017a9caf682ea0cedbc658ca6604.zip
src/device.c: Don't show parentheses around time-remaining / battery charge percentage values when in Lomiri.
-rw-r--r--src/device.c37
1 files changed, 31 insertions, 6 deletions
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 <ayatana/common/utils.h>
#include <glib/gi18n-lib.h>
#include <gio/gio.h>
@@ -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
{