Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MANIFEST1
-rw-r--r--activity.py12
-rw-r--r--po/Physics.pot107
-rw-r--r--tools.py105
4 files changed, 167 insertions, 58 deletions
diff --git a/MANIFEST b/MANIFEST
index bb9a5d6..9a3784e 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -66,3 +66,4 @@ olpcgames/data/sleeping.svg
olpcgames/data/sleeping_svg.py
icons/motor.svg
icons/pin.svg
+po/Physics.pot
diff --git a/activity.py b/activity.py
index 00161c9..2449a72 100644
--- a/activity.py
+++ b/activity.py
@@ -9,7 +9,7 @@ import gtk
class PhysicsActivity(olpcgames.PyGameActivity):
game_name = 'physics'
- game_title = 'Physics'
+ game_title = _('Physics')
game_size = None # olpcgame will choose size
# setup the toolbar
@@ -27,7 +27,7 @@ class PhysicsActivity(olpcgames.PyGameActivity):
# stop/play button
self.stop_play_state = True
self.stop_play = ToolButton('media-playback-stop')
- self.stop_play.set_tooltip(_('Stop'))
+ self.stop_play.set_tooltip(_("Stop"))
self.stop_play.set_accelerator(_('space'))
self.stop_play.connect('clicked', self.stop_play_cb)
create_toolbar.insert(self.stop_play, 0)
@@ -47,7 +47,7 @@ class PhysicsActivity(olpcgames.PyGameActivity):
else:
button.set_group(None)
firstButton = button
- button.set_tooltip(_(c.toolTip))
+ button.set_tooltip(c.toolTip)
button.set_accelerator(c.toolAccelerator)
button.connect('clicked',self.radioClicked)
create_toolbar.insert(button,-1)
@@ -55,7 +55,7 @@ class PhysicsActivity(olpcgames.PyGameActivity):
self.radioList[button] = c.name
# add the toolbars to the toolbox
- toolbox.add_toolbar("Create",create_toolbar)
+ toolbox.add_toolbar(_("Create"),create_toolbar)
create_toolbar.show()
toolbox.show()
@@ -69,10 +69,10 @@ class PhysicsActivity(olpcgames.PyGameActivity):
# Update button
if self.stop_play_state:
self.stop_play.set_icon('media-playback-stop')
- self.stop_play.set_tooltip(_('Stop'))
+ self.stop_play.set_tooltip(_("Stop"))
else:
self.stop_play.set_icon('media-playback-start')
- self.stop_play.set_tooltip(_('Start'))
+ self.stop_play.set_tooltip(_("Start"))
def radioClicked(self,button):
pygame.event.post(olpcgames.eventwrap.Event(pygame.USEREVENT, action=self.radioList[button])) \ No newline at end of file
diff --git a/po/Physics.pot b/po/Physics.pot
new file mode 100644
index 0000000..fd955e5
--- /dev/null
+++ b/po/Physics.pot
@@ -0,0 +1,107 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2009-06-22 03:08+0100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: activity/activity.info:2
+#: /home/garycmartin/sugar_olpc/physics/activity.py:12
+msgid "Physics"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/activity.py:30
+#: /home/garycmartin/sugar_olpc/physics/activity.py:72
+msgid "Stop"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/activity.py:75
+msgid "Start"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:52
+msgid "Circle"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:53
+msgid "c"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:90
+msgid "Box"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:91
+msgid "b"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:126
+msgid "Triangle"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:127
+msgid "t"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:161
+msgid "Polygon"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:162
+msgid "p"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:220
+msgid "Draw"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:221
+msgid "d"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:259
+msgid "Grab"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:260
+msgid "g"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:289
+msgid "Joint"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:339
+msgid "Pin"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:340
+msgid "o"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:363
+msgid "Motor"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:364
+msgid "m"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:389
+msgid "Erase"
+msgstr ""
+
+#: /home/garycmartin/sugar_olpc/physics/tools.py:390
+msgid "e"
+msgstr ""
diff --git a/tools.py b/tools.py
index 89420c4..dcbf185 100644
--- a/tools.py
+++ b/tools.py
@@ -7,16 +7,17 @@ import pygame
from pygame.locals import *
from helpers import *
from inspect import getmro
+from gettext import gettext as _
# tools that can be used superlcass
class Tool(object):
- name = "Tool"
- icon = "icon"
+ name = 'Tool'
+ icon = 'icon'
toolTip = "Tool Tip"
toolAccelerator = None
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Tool"
+ self.name = 'Tool'
def handleEvents(self,event):
handled = True
# default event handling
@@ -46,14 +47,14 @@ class Tool(object):
# The circle creation tool
class CircleTool(Tool):
- name = "circle"
- icon = "circle"
- toolTip = "Circle"
- toolAccelerator = "c"
+ name = 'Circle'
+ icon = 'circle'
+ toolTip = _("Circle")
+ toolAccelerator = _("c")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Circle"
+ self.name = 'Circle'
self.pt1 = None
self.radius = None
def handleEvents(self,event):
@@ -84,14 +85,14 @@ class CircleTool(Tool):
# The box creation tool
class BoxTool(Tool):
- name = "box"
- icon = "box"
- toolTip = "Box"
- toolAccelerator = "b"
+ name = 'Box'
+ icon = 'box'
+ toolTip = _("Box")
+ toolAccelerator = _("b")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Box"
+ self.name = 'Box'
self.pt1 = None
self.rect = None
def handleEvents(self,event):
@@ -120,14 +121,14 @@ class BoxTool(Tool):
# The triangle creation tool
class TriangleTool(Tool):
- name = "triangle"
- icon = "triangle"
- toolTip = "Triangle"
- toolAccelerator = "t"
+ name = 'Triangle'
+ icon = 'triangle'
+ toolTip = _("Triangle")
+ toolAccelerator = _("t")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Triangle"
+ self.name = 'Triangle'
self.pt1 = None
self.vertices = None
def handleEvents(self,event):
@@ -155,14 +156,14 @@ class TriangleTool(Tool):
# The Polygon creation tool
class PolygonTool(Tool):
- name = "polygon"
- icon = "polygon"
- toolTip = "Polygon"
- toolAccelerator = "p"
+ name = 'Polygon'
+ icon = 'polygon'
+ toolTip = _("Polygon")
+ toolAccelerator = _("p")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Polygon"
+ self.name = 'Polygon'
self.vertices = None
def handleEvents(self,event):
#look for default events, and if none are handled then try the custom events
@@ -214,14 +215,14 @@ class PolygonTool(Tool):
# The magic pen tool
class MagicPenTool(Tool):
- name = "magicpen"
- icon = "magicpen"
- toolTip = "Draw"
- toolAccelerator = "d"
+ name = 'Magicpen'
+ icon = 'magicpen'
+ toolTip = _("Draw")
+ toolAccelerator = _("d")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Draw"
+ self.name = 'Magicpen'
self.vertices = None
def handleEvents(self,event):
#look for default events, and if none are handled then try the custom events
@@ -253,14 +254,14 @@ class MagicPenTool(Tool):
# The grab tool
class GrabTool(Tool):
- name = "grab"
- icon = "grab"
- toolTip = "Grab"
- toolAccelerator = "g"
+ name = 'Grab'
+ icon = 'grab'
+ toolTip = _("Grab")
+ toolAccelerator = _("g")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Grab"
+ self.name = 'Grab'
def handleEvents(self,event):
#look for default events, and if none are handled then try the custom events
if not super(GrabTool,self).handleEvents(event):
@@ -283,14 +284,14 @@ class GrabTool(Tool):
# The joint tool
class JointTool(Tool):
- name = "joint"
- icon = "joint"
- toolTip = "Joint"
+ name = 'Joint'
+ icon = 'joint'
+ toolTip = _("Joint")
toolAccelerator = "j"
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Joint"
+ self.name = 'Joint'
self.jb1 = self.jb2 = self.jb1pos = self.jb2pos = None
def handleEvents(self,event):
#look for default events, and if none are handled then try the custom events
@@ -333,14 +334,14 @@ class JointTool(Tool):
# The pin tool
class PinTool(Tool):
- name = "pin"
- icon = "pin"
- toolTip = "Pin"
- toolAccelerator = "o"
+ name = 'Pin'
+ icon = 'pin'
+ toolTip = _("Pin")
+ toolAccelerator = _("o")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Pin"
+ self.name = 'Pin'
self.jb1 = self.jb1pos = None
def handleEvents(self,event):
#look for default events, and if none are handled then try the custom events
@@ -357,14 +358,14 @@ class PinTool(Tool):
# The motor tool
class MotorTool(Tool):
- name = "motor"
- icon = "motor"
- toolTip = "Motor"
- toolAccelerator = "m"
+ name = 'Motor'
+ icon = 'motor'
+ toolTip = _("Motor")
+ toolAccelerator = _("m")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Motor"
+ self.name = 'Motor'
self.jb1 = self.jb1pos = None
def handleEvents(self,event):
#look for default events, and if none are handled then try the custom events
@@ -383,14 +384,14 @@ class MotorTool(Tool):
# The destroy tool
class DestroyTool(Tool):
- name = "destroy"
- icon = "destroy"
- toolTip = "Erase"
- toolAccelerator = "e"
+ name = 'Destroy'
+ icon = 'destroy'
+ toolTip = _("Erase")
+ toolAccelerator = _("e")
def __init__(self,gameInstance):
self.game = gameInstance
- self.name = "Erase"
+ self.name = 'Destroy'
self.vertices = None
def handleEvents(self,event):
#look for default events, and if none are handled then try the custom events