aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-06-06 16:34:09 +0200
committerRobert Tari <robert@tari.in>2023-06-08 23:47:45 +0200
commit0ed3e1762249d7c1ab954e7fa16543bb16d58f60 (patch)
tree1db2553ff556ce72097c1746c8eb25d09af534ab /src
parent37ce149f5b4d422f8329e27aff7277f5fe309d7d (diff)
downloadayatana-indicator-power-0ed3e1762249d7c1ab954e7fa16543bb16d58f60.tar.gz
ayatana-indicator-power-0ed3e1762249d7c1ab954e7fa16543bb16d58f60.tar.bz2
ayatana-indicator-power-0ed3e1762249d7c1ab954e7fa16543bb16d58f60.zip
src/device.c: Don't show parentheses around time-remaining / battery charge percentage values when in Lomiri.
Diffstat (limited to 'src')
-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
{