[PATCH 2/3] Translate AM and PM
David Shea
dshea at redhat.com
Thu Oct 17 17:55:40 UTC 2013
Also, there's no need for two functions to switch between "AM" and "PM".
---
pyanaconda/ui/gui/spokes/datetime_spoke.glade | 4 ++--
pyanaconda/ui/gui/spokes/datetime_spoke.py | 16 ++++------------
2 files changed, 6 insertions(+), 14 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.glade b/pyanaconda/ui/gui/spokes/datetime_spoke.glade
index 70043a1..4d50466 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.glade
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.glade
@@ -354,7 +354,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">upImage1</property>
- <signal name="clicked" handler="on_up_ampm_clicked" swapped="no"/>
+ <signal name="clicked" handler="on_updown_ampm_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">4</property>
@@ -384,7 +384,7 @@
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="image">downImage1</property>
- <signal name="clicked" handler="on_down_ampm_clicked" swapped="no"/>
+ <signal name="clicked" handler="on_updown_ampm_clicked" swapped="no"/>
</object>
<packing>
<property name="left_attach">4</property>
diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py
index 34f15e5..577f3fa 100644
--- a/pyanaconda/ui/gui/spokes/datetime_spoke.py
+++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py
@@ -753,21 +753,13 @@ class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke):
minutes_str = "%0.2d" % ((minutes - 1) % 60)
self._minutesLabel.set_text(minutes_str)
- def on_up_ampm_clicked(self, *args):
+ def on_updown_ampm_clicked(self, *args):
self._stop_and_maybe_start_time_updating()
- if self._amPmLabel.get_text() == "AM":
- self._amPmLabel.set_text("PM")
+ if self._amPmLabel.get_text() == _("AM"):
+ self._amPmLabel.set_text(_("PM"))
else:
- self._amPmLabel.set_text("AM")
-
- def on_down_ampm_clicked(self, *args):
- self._stop_and_maybe_start_time_updating()
-
- if self._amPmLabel.get_text() == "AM":
- self._amPmLabel.set_text("PM")
- else:
- self._amPmLabel.set_text("AM")
+ self._amPmLabel.set_text(_("AM"))
def on_region_changed(self, combo, *args):
"""
--
1.8.3.1
More information about the anaconda-patches
mailing list