[gnome-settings-daemon] power: Reduce amount of markup in translated messages
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] power: Reduce amount of markup in translated messages
- Date: Tue, 10 Jul 2012 11:33:35 +0000 (UTC)
commit 2ff41b0d42c39e79a089f9e230c9ba2f81d63f8c
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jul 9 23:04:16 2012 -0400
power: Reduce amount of markup in translated messages
Markup in messages is fragile and tends to break in translations.
This commit reduces the amount of markup as far as possible.
plugins/power/gsd-power-manager.c | 23 ++++++++++++++++-------
1 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/plugins/power/gsd-power-manager.c b/plugins/power/gsd-power-manager.c
index 8f152d6..ed5e56d 100644
--- a/plugins/power/gsd-power-manager.c
+++ b/plugins/power/gsd-power-manager.c
@@ -1332,6 +1332,7 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device)
const gchar *title = NULL;
gboolean ret;
gchar *message = NULL;
+ gchar *tmp;
gchar *remaining_text;
gdouble percentage;
GIcon *icon = NULL;
@@ -1365,20 +1366,25 @@ engine_charge_low (GsdPowerManager *manager, UpDevice *device)
/* TRANSLATORS: laptop battery low, and we have more than one kind of battery */
title = _("Laptop battery low");
}
-
- remaining_text = gpm_get_timestring (time_to_empty);
+ tmp = gpm_get_timestring (time_to_empty);
+ remaining_text = g_strconcat ("<b>", tmp, "</b>", NULL);
+ g_free (tmp);
/* TRANSLATORS: tell the user how much time they have got */
- message = g_strdup_printf (_("Approximately <b>%s</b> remaining (%.0f%%)"), remaining_text, percentage);
+ message = g_strdup_printf (_("Approximately %s remaining (%.0f%%)"), remaining_text, percentage);
+ g_free (remaining_text);
} else if (kind == UP_DEVICE_KIND_UPS) {
/* TRANSLATORS: UPS is starting to get a little low */
title = _("UPS low");
- remaining_text = gpm_get_timestring (time_to_empty);
+ tmp = gpm_get_timestring (time_to_empty);
+ remaining_text = g_strconcat ("<b>", tmp, "</b>", NULL);
+ g_free (tmp);
/* TRANSLATORS: tell the user how much time they have got */
- message = g_strdup_printf (_("Approximately <b>%s</b> of remaining UPS backup power (%.0f%%)"),
+ message = g_strdup_printf (_("Approximately %s of remaining UPS backup power (%.0f%%)"),
remaining_text, percentage);
+ g_free (remaining_text);
} else if (kind == UP_DEVICE_KIND_MOUSE) {
/* TRANSLATORS: mouse is getting a little low */
title = _("Mouse battery low");
@@ -1533,13 +1539,16 @@ engine_charge_critical (GsdPowerManager *manager, UpDevice *device)
} else if (kind == UP_DEVICE_KIND_UPS) {
gchar *remaining_text;
+ gchar *tmp;
/* TRANSLATORS: the UPS is very low */
title = _("UPS critically low");
- remaining_text = gpm_get_timestring (time_to_empty);
+ tmp = gpm_get_timestring (time_to_empty);
+ remaining_text = g_strconcat ("<b>", tmp", </b>", NULL);
+ g_free (tmp);
/* TRANSLATORS: give the user a ultimatum */
- message = g_strdup_printf (_("Approximately <b>%s</b> of remaining UPS power (%.0f%%). "
+ message = g_strdup_printf (_("Approximately %s of remaining UPS power (%.0f%%). "
"Restore AC power to your computer to avoid losing data."),
remaining_text, percentage);
g_free (remaining_text);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]