From a11d75ef85ca7edf14fdb28e65e47c8c9f7aa79b Mon Sep 17 00:00:00 2001 From: nrp Date: Sun, 14 Sep 2008 05:18:02 +0000 Subject: adding i18n, specifically es --- diff --git a/icons/joint.svg b/icons/joint.svg index f26c41f..4a83b85 100755 --- a/icons/joint.svg +++ b/icons/joint.svg @@ -1,11 +1,81 @@ - - - - - - - - - - + + +image/svg+xml + + + + + + \ No newline at end of file diff --git a/locale/es/LC_MESSAGES/org.laptop.bridge.mo b/locale/es/LC_MESSAGES/org.laptop.bridge.mo new file mode 100644 index 0000000..36071cc --- /dev/null +++ b/locale/es/LC_MESSAGES/org.laptop.bridge.mo Binary files differ diff --git a/physics.py b/physics.py index 267979f..57c9d46 100644 --- a/physics.py +++ b/physics.py @@ -25,6 +25,7 @@ from elements import Elements import tools from bridge import Bridge from helpers import * +from gettext import gettext as _ class PhysicsGame: def __init__(self,screen): @@ -79,20 +80,20 @@ class PhysicsGame: self.currentTool.draw() #Print all the text on the screen - text = self.font.render("Total Cost: %d" % self.bridge.cost, True, (0,0,0)) + text = self.font.render(_("Total Cost: %d") % self.bridge.cost, True, (0,0,0)) textpos = text.get_rect(left=100,top=7) self.screen.blit(text,textpos) ratio = self.bridge.stress*100/self.bridge.capacity - text = self.font.render("Stress: %d%%" % ratio, True, (0,0,0)) + text = self.font.render(_("Stress: %d%%") % ratio, True, (0,0,0)) textpos = text.get_rect(left=100,top=25) self.screen.blit(text,textpos) if self.bridge.train_off_screen: - text = self.font.render("Train fell off the screen, press R to try again!", True, (0,0,0)) + text = self.font.render(_("Train fell off the screen, press R to try again!"), True, (0,0,0)) elif self.bridge.level_completed: - text = self.font.render("Level completed, well done!! Press T to send another train.", True, (0,0,0)) + text = self.font.render(_("Level completed, well done!! Press T to send another train."), True, (0,0,0)) else: - text = self.font.render("Press the Spacebar to start/pause.", True, (0,0,0)) + text = self.font.render(_("Press the Spacebar to start/pause."), True, (0,0,0)) textpos = text.get_rect(left=100,top=43) self.screen.blit(text,textpos) diff --git a/po/Bridge.pot b/po/Bridge.pot new file mode 100644 index 0000000..ce481ba --- /dev/null +++ b/po/Bridge.pot @@ -0,0 +1,68 @@ +# 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 , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-09-14 00:29-0400\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=CHARSET\n" +"Content-Transfer-Encoding: 8bit\n" + +#: activity/activity.info:2 +msgid "Bridge" +msgstr "" + +#: physics.py:83 +#, python-format +msgid "Total Cost: %d" +msgstr "" + +#: physics.py:87 +#, python-format +msgid "Stress: %d%%" +msgstr "" + +#: physics.py:92 +msgid "Train fell off the screen, press R to try again!" +msgstr "" + +#: physics.py:94 +msgid "Level completed, well done!! Press T to send another train." +msgstr "" + +#: physics.py:96 +msgid "Press the Spacebar to start/pause." +msgstr "" + +#: tools.py:77 +msgid "Circle" +msgstr "" + +#: tools.py:114 +msgid "Girder" +msgstr "" + +#: tools.py:175 +msgid "Grab" +msgstr "" + +#: tools.py:205 +msgid "Destroy" +msgstr "" + +#: tools.py:244 +msgid "Bridge Joint" +msgstr "" + +#: olpcgames/canvas.py:151 +#, python-format +msgid "%s Source" +msgstr "" diff --git a/po/POTFILES.in b/po/POTFILES.in new file mode 100644 index 0000000..d2a59d3 --- /dev/null +++ b/po/POTFILES.in @@ -0,0 +1,3 @@ +encoding: UTF-8 +tools.py +physics.py diff --git a/po/es.po b/po/es.po new file mode 100644 index 0000000..6bb0fa4 --- /dev/null +++ b/po/es.po @@ -0,0 +1,68 @@ +# Spanish translations for physics package. +# Copyright (C) 2008 THE physics'S COPYRIGHT HOLDER +# This file is distributed under the same license as the physics package. +# Nirav Patel , 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: physics 03\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2008-09-14 00:29-0400\n" +"PO-Revision-Date: 2008-09-14 00:30-0400\n" +"Last-Translator: Nirav Patel \n" +"Language-Team: Spanish\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=ASCII\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#: activity/activity.info:2 +msgid "Bridge" +msgstr "Puente" + +#: physics.py:83 +#, python-format +msgid "Total Cost: %d" +msgstr "Coste Total: %d" + +#: physics.py:87 +#, python-format +msgid "Stress: %d%%" +msgstr "Presion: %d%%" + +#: physics.py:92 +msgid "Train fell off the screen, press R to try again!" +msgstr "Tren cayo. Pulsas R para trate otra vez." + +#: physics.py:94 +msgid "Level completed, well done!! Press T to send another train." +msgstr "Ganas juego, muy bien!! Pulsas T para otro tren." + +#: physics.py:96 +msgid "Press the Spacebar to start/pause." +msgstr "Pulsas la barra espaciadora para comenza o descansa." + +#: tools.py:77 +msgid "Circle" +msgstr "Circulo" + +#: tools.py:114 +msgid "Girder" +msgstr "Viga" + +#: tools.py:175 +msgid "Grab" +msgstr "Agarra" + +#: tools.py:205 +msgid "Destroy" +msgstr "Borra" + +#: tools.py:244 +msgid "Bridge Joint" +msgstr "Juntura de Puente" + +#: olpcgames/canvas.py:151 +#, python-format +msgid "%s Source" +msgstr "%s Fuente" diff --git a/setup.py b/setup.py index 6ed89aa..793a078 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ #!/usr/bin/env python from sugar.activity import bundlebuilder -bundlebuilder.start() +bundlebuilder.start("Bridge") diff --git a/tools.py b/tools.py index 51eeefe..d61f748 100644 --- a/tools.py +++ b/tools.py @@ -9,6 +9,7 @@ from pygame.locals import * from helpers import * from inspect import getmro import math +from gettext import gettext as _ def distance(pt1, pt2): return math.sqrt((pt1[0] - pt2[0]) ** 2 + (pt1[1] -pt2[1]) ** 2) @@ -73,7 +74,7 @@ class Tool(object): class CircleTool(Tool): name = "circle" icon = "circle" - toolTip = "Circle" + toolTip = _("Circle") def __init__(self,gameInstance): self.game = gameInstance @@ -110,7 +111,7 @@ class CircleTool(Tool): class GirderTool(Tool): name = "girder" icon = "box" - toolTip = "Girder" + toolTip = _("Girder") def __init__(self,gameInstance): self.game = gameInstance @@ -171,7 +172,7 @@ class GirderTool(Tool): class GrabTool(Tool): name = "grab" icon = "grab" - toolTip = "Grab" + toolTip = _("Grab") def __init__(self,gameInstance): self.game = gameInstance @@ -201,7 +202,7 @@ class GrabTool(Tool): class DestroyTool(Tool): name = "destroy" icon = "destroy" - toolTip = "Destroy" + toolTip = _("Destroy") def __init__(self,gameInstance): self.game = gameInstance @@ -240,7 +241,7 @@ class DestroyTool(Tool): class BridgeJointTool(Tool): name = "bridgejoint" icon = "joint" - toolTip = "Bridge Joint" + toolTip = _("Bridge Joint") def __init__(self,gameInstance): self.game = gameInstance -- cgit v0.9.1