diff options
-rwxr-xr-x | clock.py | 49 | ||||
-rwxr-xr-x | speaker.py | 13 |
2 files changed, 31 insertions, 31 deletions
@@ -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", - '<markup><span lang="en" font_desc="Sans 20">%s</span></markup>') + self._TIME_LETTERS_FORMAT = _('<markup>\ +<span lang="en" font_desc="Sans 20">%s</span></markup>') # 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", - '<markup><span lang="en" font_desc="Sans 20">' + - '<span foreground="#B20008">%A</span>, ' + - '<span foreground="#5E008C">%m</span>/' + - '<span foreground="#B20008">%d</span>/' + - '<span foreground="#9A5200">%Y</span></span></markup>') + self._DATE_SHORT_FORMAT = _('<markup>\ +<span lang="en" font_desc="Sans 20">\ +<span foreground="#B20008">%A</span>, \ +<span foreground="#5E008C">%m</span>/\ +<span foreground="#B20008">%d</span>/\ +<span foreground="#9A5200">%Y</span></span></markup>') # 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", - '<markup><span lang="en" font_desc="Sans,Monospace Bold 48">' + - '<span foreground="#005FE4">%I</span>:' + - '<span foreground="#00B20D">%M</span>:' + - '<span foreground="#E6000A">%S</span>%p</span></markup>') + markup = _('<markup>\ +<span lang="en" font_desc="Sans,Monospace Bold 48">\ +<span foreground="#005FE4">%I</span>:\ +<span foreground="#00B20D">%M</span>:\ +<span foreground="#E6000A">%S</span>%p</span></markup>') # 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", - '<markup><span lang="en" ' + - 'font_desc="Sans Bold 20">%d</span></markup>') % (i + 1) + hour_number = _('<markup><span lang="en" \ +font_desc="Sans Bold 20">%d</span></markup>') % (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 * \ @@ -15,7 +15,7 @@ Controls the espeak program available on the OLPC XO laptop. import sys import os -from pgettext import pgettext as _ +from gettext import gettext as _ class Speaker: @@ -26,21 +26,22 @@ class Speaker: """ # TRANS: The language pitch (range [0 - 99], default 50 for English) # Look at http://espeak.sourceforge.net/commands.html for details - PITCH = _("espeak-pitch", "50") + PITCH = _("50") """espeak parameter: diction speed (average words per minute). """ - # TRANS: The diction speed, in average words per minute (range [80 - 390], default 170 for English). + # TRANS: The diction speed, in average words per minute (range [80 - 390], + # default 170 for English). # Look at http://espeak.sourceforge.net/commands.html for details - SPEED = _("espeak-speed", "170") + SPEED = _("170") """espeak parameter: word gap in units of 10 ms. """ # TRANS: The pause duration between words, in units of 10 ms. # Look at http://espeak.sourceforge.net/commands.html for details - WORD_GAP = _("espeak-wgap", "0") + WORD_GAP = _("0") """espeak parameter: the language and voice variant. @@ -48,7 +49,7 @@ class Speaker: # TRANS: The language and voice variant # Look at http://espeak.sourceforge.net/commands.html for details, and # http://espeak.sourceforge.net/languages.html to see if your language is supported. - VOICE = _("espeak-voice", "en") + VOICE = _("en") def speak(self, text): |