aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-03-25 14:35:17 -0500
committerCharles Kerr <charles.kerr@canonical.com>2014-03-25 14:35:17 -0500
commit9b33101ad8a9fc093e226c25e497fd8b1d51aee5 (patch)
treec9786cf4a2d408f0cba8572e0abf37f7d6d54de2
parent0ea6d3db58a5e795dbe7eaf355b56ef4555e3e9f (diff)
downloadayatana-indicator-power-9b33101ad8a9fc093e226c25e497fd8b1d51aee5.tar.gz
ayatana-indicator-power-9b33101ad8a9fc093e226c25e497fd8b1d51aee5.tar.bz2
ayatana-indicator-power-9b33101ad8a9fc093e226c25e497fd8b1d51aee5.zip
add translator comments to the new translatable strings.
-rw-r--r--src/device.c53
1 files changed, 40 insertions, 13 deletions
diff --git a/src/device.c b/src/device.c
index e7384ee..8b97ef5 100644
--- a/src/device.c
+++ b/src/device.c
@@ -610,10 +610,12 @@ get_expanded_time_remaining (const IndicatorPowerDevice * device,
if (p->state == UP_DEVICE_STATE_CHARGING)
{
+ /* TRANSLATORS: H:MM (hours, minutes) to charge the battery. Example: "1:30 to charge" */
g_snprintf (str, size, _("%0d:%02d to charge"), hours, minutes);
}
else // discharging
{
+ /* TRANSLATORS: H:MM (hours, minutes) to discharge the battery. Example: "1:30 left"*/
g_snprintf (str, size, _("%0d:%02d left"), hours, minutes);
}
}
@@ -652,22 +654,38 @@ get_accessible_time_remaining (const IndicatorPowerDevice * device,
if (p->state == UP_DEVICE_STATE_CHARGING)
{
if (hours > 0)
- g_snprintf (str, size, _("%d %s %d %s to charge"),
- hours, g_dngettext (NULL, "hour", "hours", hours),
- minutes, g_dngettext (NULL, "minute", "minutes", minutes));
+ {
+ /* TRANSLATORS: "X (hour,hours) Y (minute,minutes) to charge" the battery.
+ Example: "1 hour 10 minutes to charge" */
+ g_snprintf (str, size, _("%d %s %d %s to charge"),
+ hours, g_dngettext (NULL, "hour", "hours", hours),
+ minutes, g_dngettext (NULL, "minute", "minutes", minutes));
+ }
else
- g_snprintf (str, size, _("%d %s to charge"),
- minutes, g_dngettext (NULL, "minute", "minutes", minutes));
+ {
+ /* TRANSLATORS: "Y (minute,minutes) to charge" the battery.
+ Example: "59 minutes to charge" */
+ g_snprintf (str, size, _("%d %s to charge"),
+ minutes, g_dngettext (NULL, "minute", "minutes", minutes));
+ }
}
else // discharging
{
if (hours > 0)
- g_snprintf (str, size, _("%d %s %d %s left"),
- hours, g_dngettext (NULL, "hour", "hours", hours),
- minutes, g_dngettext (NULL, "minute", "minutes", minutes));
- else
- g_snprintf (str, size, _("%d %s left"),
- minutes, g_dngettext (NULL, "minute", "minutes", minutes));
+ {
+ /* TRANSLATORS: "X (hour,hours) Y (minute,minutes) left" until the battery's empty.
+ Example: "1 hour 10 minutes left" */
+ g_snprintf (str, size, _("%d %s %d %s left"),
+ hours, g_dngettext (NULL, "hour", "hours", hours),
+ minutes, g_dngettext (NULL, "minute", "minutes", minutes));
+ }
+ else
+ {
+ /* TRANSLATORS: "Y (minute,minutes) left" until the battery's empty.
+ Example: "59 minutes left" */
+ g_snprintf (str, size, _("%d %s left"),
+ minutes, g_dngettext (NULL, "minute", "minutes", minutes));
+ }
}
}
else
@@ -720,6 +738,7 @@ get_menuitem_text (const IndicatorPowerDevice * device,
if (p->state == UP_DEVICE_STATE_FULLY_CHARGED)
{
+ /* TRANSLATORS: example: "battery (charged)" */
g_snprintf (str, size, _("%s (charged)"), kind_str);
}
else
@@ -739,9 +758,14 @@ get_menuitem_text (const IndicatorPowerDevice * device,
}
if (*buf)
- g_snprintf (str, size, _("%s (%s)"), kind_str, buf);
+ {
+ /* TRANSLATORS: example: "battery (time remaining)" */
+ g_snprintf (str, size, _("%s (%s)"), kind_str, buf);
+ }
else
- g_strlcpy (str, kind_str, size);
+ {
+ g_strlcpy (str, kind_str, size);
+ }
}
}
@@ -819,14 +843,17 @@ 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%)" */
g_snprintf (str, size, _("(%s, %.0lf%%)"), tr, p->percentage);
}
else if (want_time)
{
+ /* TRANSLATORS: after the icon, a time-remaining string Example: "(0:59)" */
g_snprintf (str, size, _("(%s)"), tr);
}
else if (want_percent)
{
+ /* TRANSLATORS: after the icon, a battery %. Example: "(33%)" */
g_snprintf (str, size, _("(%.0lf%%)"), p->percentage);
}
else