Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornrp <olpc@spongezone.net>2008-09-14 05:18:02 (GMT)
committer nrp <olpc@spongezone.net>2008-09-14 05:18:02 (GMT)
commita11d75ef85ca7edf14fdb28e65e47c8c9f7aa79b (patch)
treeae87fca35389d1903cdc5245424e0160d0b6a9ff
parent0ff169da67e21004735d902f48e077489d576c09 (diff)
adding i18n, specifically es
-rwxr-xr-xicons/joint.svg92
-rw-r--r--locale/es/LC_MESSAGES/org.laptop.bridge.mobin0 -> 1113 bytes
-rw-r--r--physics.py11
-rw-r--r--po/Bridge.pot68
-rw-r--r--po/POTFILES.in3
-rw-r--r--po/es.po68
-rwxr-xr-xsetup.py2
-rw-r--r--tools.py11
8 files changed, 233 insertions, 22 deletions
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 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
-<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="55px"
- height="55px" viewBox="0 0 55 55" enable-background="new 0 0 55 55" xml:space="preserve">
-
-<g id="Line" >
- <line display="inline" fill="none" stroke="#FFFFFF" stroke-width="2.25" x1="8.708" y1="47.167" x2="48.042" y2="7.833"/>
-</g>
-
-</svg>
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 13.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 14948) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ x="0px"
+ y="0px"
+ width="55px"
+ height="55px"
+ viewBox="0 0 55 55"
+ enable-background="new 0 0 55 55"
+ xml:space="preserve"
+ id="svg2"
+ sodipodi:version="0.32"
+ inkscape:version="0.46"
+ sodipodi:docname="joint.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape"><metadata
+ id="metadata10"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs8"><inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 27.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="55 : 27.5 : 1"
+ inkscape:persp3d-origin="27.5 : 18.333333 : 1"
+ id="perspective12" /></defs><sodipodi:namedview
+ inkscape:window-height="854"
+ inkscape:window-width="1440"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="8.9818182"
+ inkscape:cx="10.415008"
+ inkscape:cy="28.657344"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:current-layer="svg2" />
+
+<rect
+ style="fill:#333333;fill-opacity:1;stroke:#333333;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect3169"
+ width="29.281376"
+ height="21.153847"
+ x="21.376518"
+ y="15.587045"
+ ry="0.64486545" /><rect
+ style="fill:#666666;fill-opacity:1;stroke:#666666;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="rect3167"
+ width="37.186234"
+ height="18.481781"
+ x="3.8967612"
+ y="16.700405"
+ ry="0.64486545" /><g
+ id="Line">
+
+</g>
+
+<path
+ sodipodi:type="arc"
+ style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path3163"
+ sodipodi:cx="27.722672"
+ sodipodi:cy="26.609312"
+ sodipodi:rx="3.7854252"
+ sodipodi:ry="3.7854252"
+ d="M 31.508097,26.609312 A 3.7854252,3.7854252 0 1 1 23.937246,26.609312 A 3.7854252,3.7854252 0 1 1 31.508097,26.609312 z"
+ transform="translate(1.1133604,-0.5566802)" /></svg> \ 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 <EMAIL@ADDRESS>, 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 <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
+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 <olpc@spongezone.net>, 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 <olpc@spongezone.net>\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