From 8b9af018bde0b2910c731401cc0ba26283ba6adc Mon Sep 17 00:00:00 2001 From: Gary C Martin Date: Tue, 12 Jun 2012 02:45:58 +0000 Subject: Replace pgettext with gettext to work around broken genpot string generation SL#3668 --- (limited to 'clock.py') diff --git a/clock.py b/clock.py index 1219aee..82b9da2 100755 --- a/clock.py +++ b/clock.py @@ -86,7 +86,7 @@ import threading import gc import re -from pgettext import pgettext as _ +from gettext import gettext as _ from sugar.activity import activity from sugar.graphics.toggletoolbutton import ToggleToolButton @@ -117,7 +117,7 @@ class ClockActivity(activity.Activity): super(ClockActivity, self).__init__(handle) # TRANS: Title of the activity - self.set_title(_("Activity", "What Time Is It?")) + self.set_title(_('What Time Is It?')) # TRANS: The format used when writing the time in full # letters. You must take care to use a font size large enough @@ -125,20 +125,20 @@ class ClockActivity(activity.Activity): # that all times combination fit on the screen, even when the # screen is rotated. Pango markup: # http://www.pygtk.org/docs/pygtk/pango-markup-language.html - self._TIME_LETTERS_FORMAT = _("Write Time", - '%s') + self._TIME_LETTERS_FORMAT = _('\ +%s') # TRANS: The format used to display the weekday and date # (example: Tuesday 10/21/2008) We recommend to use the same # font size as for the time display. See # http://docs.python.org/lib/module-time.html for available # strftime formats. xgettext:no-python-format - self._DATE_SHORT_FORMAT = _("Write Date", - '' + - '%A, ' + - '%m/' + - '%d/' + - '%Y') + self._DATE_SHORT_FORMAT = _('\ +\ +%A, \ +%m/\ +%d/\ +%Y') # Should we write the time in full letters? self._write_time = False @@ -229,7 +229,7 @@ class ClockActivity(activity.Activity): # Add the toolbar to the activity menu self._add_clock_controls(display_toolbar) - toolbox.add_toolbar(_("Toolbar", "Clock"), display_toolbar) + toolbox.add_toolbar(_('Clock'), display_toolbar) toolbox.set_current_toolbar(1) return toolbox @@ -260,19 +260,19 @@ class ClockActivity(activity.Activity): # First group of radio button to select the type of clock to display button1 = RadioToolButton(named_icon="simple-clock") - button1.set_tooltip(_("Toolbar", "Simple Clock")) + button1.set_tooltip(_('Simple Clock')) button1.connect("toggled", self._display_mode_changed_cb, _MODE_SIMPLE_CLOCK) display_toolbar.insert(button1, -1) button2 = RadioToolButton(named_icon="nice-clock", group=button1) - button2.set_tooltip(_("Toolbar", "Nice Clock")) + button2.set_tooltip(_('Nice Clock')) button2.connect("toggled", self._display_mode_changed_cb, _MODE_NICE_CLOCK) display_toolbar.insert(button2, -1) button3 = RadioToolButton(named_icon="digital-clock", group=button1) - button3.set_tooltip(_("Toolbar", "Digital Clock")) + button3.set_tooltip(_('Digital Clock')) button3.connect("toggled", self._display_mode_changed_cb, _MODE_DIGITAL_CLOCK) display_toolbar.insert(button3, -1) @@ -286,13 +286,13 @@ class ClockActivity(activity.Activity): # of week... A button in the toolbar to write the time in # full letters button = ToggleToolButton("write-time") - button.set_tooltip(_("Toolbar", "Display time in full letters")) + button.set_tooltip(_('Display time in full letters')) button.connect("toggled", self._write_time_clicked_cb) display_toolbar.insert(button, -1) # The button to display the weekday and date button = ToggleToolButton("write-date") - button.set_tooltip(_("Toolbar", "Display weekday and date")) + button.set_tooltip(_('Display weekday and date')) button.connect("toggled", self._write_date_clicked_cb) display_toolbar.insert(button, -1) @@ -303,7 +303,7 @@ class ClockActivity(activity.Activity): # Another button to speak aloud the time button = ToggleToolButton("speak-time") - button.set_tooltip(_("Toolbar", "Talking clock")) + button.set_tooltip(_('Talking clock')) button.connect("toggled", self._speak_time_clicked_cb) display_toolbar.insert(button, -1) @@ -660,11 +660,11 @@ class ClockFace(gtk.DrawingArea): # horizontally, it means that the glyphs of the digits used in # the font don't have the same width. Try to use a Monospace # font. xgettext:no-python-format - markup = _("Digital Clock", - '' + - '%I:' + - '%M:' + - '%S%p') + markup = _('\ +\ +%I:\ +%M:\ +%S%p') # BUG: The following line kills Python 2.5 but is valid in 2.4 markup_time = self._time.strftime(markup) #markup_time = time.strftime(markup) @@ -783,9 +783,8 @@ class ClockFace(gtk.DrawingArea): for i in xrange(12): # TRANS: The format of the font used to print hour # numbers, from 1 to 12. - hour_number = _("Hour Number", - '%d') % (i + 1) + hour_number = _('%d') % (i + 1) self._draw_markup(self._center_x + 0.75 * \ self._radius * math.cos((i - 2) * math.pi / 6.0), \ self._center_y + 0.75 * self._radius * \ -- cgit v0.9.1