From c5812c3cccbfc53bc8e39fc0d8249ddbae19eeed Mon Sep 17 00:00:00 2001 From: Kalev Lember Date: Sun, 18 Aug 2013 23:12:38 +0200 Subject: [PATCH] datetime: Mark the time format strings as translatable ... and add translator comments explainings what they do. The RTL languages are likely going to want to show them in a different order. We should eventually move to just using GnomeWallClock and/or g_date_time_format with %c that already have translated the time format strings. However, in case this doesn't make it in time for 3.10, mark the current strings in g-c-c as translatable to get some translation coverage. https://bugzilla.gnome.org/show_bug.cgi?id=694985 --- panels/datetime/cc-datetime-panel.c | 25 ++++++++++++++++++++----- po/POTFILES.in | 1 + 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/panels/datetime/cc-datetime-panel.c b/panels/datetime/cc-datetime-panel.c index 3b7d64640..5b5e75170 100644 --- a/panels/datetime/cc-datetime-panel.c +++ b/panels/datetime/cc-datetime-panel.c @@ -36,6 +36,7 @@ #include #include +#include #include #include #include @@ -316,9 +317,15 @@ update_time (CcDateTimePanel *self) /* Update the time on the listbow row */ if (use_ampm) - label = g_date_time_format (priv->date, "%e %B %Y, %l:%M %p"); + { + /* Translators: This is the full date and time format used in 12-hour mode. */ + label = g_date_time_format (priv->date, _("%e %B %Y, %l:%M %p")); + } else - label = g_date_time_format (priv->date, "%e %B %Y, %R"); + { + /* Translators: This is the full date and time format used in 24-hour mode. */ + label = g_date_time_format (priv->date, _("%e %B %Y, %R")); + } gtk_label_set_text (GTK_LABEL (W ("datetime_label")), label); g_free (label); @@ -531,12 +538,20 @@ update_timezone (CcDateTimePanel *self) gtk_label_set_text (GTK_LABEL (W ("timezone_label")), label); g_free (label); - utc_label = g_date_time_format (priv->date, "UTC%z"); + /* Translators: UTC here means the Coordinated Universal Time. + * %z will be replaced by the offset from UTC e.g. UTC+0200 */ + utc_label = g_date_time_format (priv->date, _("UTC%z")); if (use_ampm) - time_label = g_date_time_format (priv->date, "%l:%M %p"); + { + /* Translators: This is the time format used in 12-hour mode. */ + time_label = g_date_time_format (priv->date, _("%l:%M %p")); + } else - time_label = g_date_time_format (priv->date, "%R"); + { + /* Translators: This is the time format used in 24-hour mode. */ + time_label = g_date_time_format (priv->date, _("%R")); + } /* Update the text bubble in the timezone map */ bubble_text = g_strdup_printf ("%s (%s)\n" diff --git a/po/POTFILES.in b/po/POTFILES.in index 29df4d4f7..835c571d8 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -22,6 +22,7 @@ panels/common/cc-common-language.c panels/common/cc-language-chooser.c panels/common/cc-util.c [type: gettext/glade]panels/common/language-chooser.ui +panels/datetime/cc-datetime-panel.c [type: gettext/glade]panels/datetime/datetime.ui panels/datetime/gnome-datetime-panel.desktop.in.in panels/datetime/org.gnome.controlcenter.datetime.policy.in