Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAneesh Dogra <lionaneesh@gmail.com>2012-11-27 08:22:56 (GMT)
committer Aneesh Dogra <lionaneesh@gmail.com>2012-11-27 08:26:29 (GMT)
commit99e178fd0646a4cd67d74df8a25dda633bd27de8 (patch)
treed3f86b5da08bda77ea8c1952c265a2bac07dd9bf
parentdfd109011cf71dac5a48a407f1914e6a8ada75d4 (diff)
I18n strings.
-rw-r--r--BiblioJAM/JAMBoard.py6
-rw-r--r--BiblioJAM/JAMBoardEntryText.py4
-rw-r--r--BiblioJAM/JAMBoardTypes.py4
-rw-r--r--BiblioJAM/JAMBook.py6
-rw-r--r--BiblioJAM/JAMButton.py6
-rw-r--r--BiblioJAM/JAMCalendar.py4
-rw-r--r--BiblioJAM/JAMClock.py4
-rw-r--r--BiblioJAM/JAMComboBox.py8
-rw-r--r--BiblioJAM/JAMCron.py4
-rw-r--r--BiblioJAM/JAMDialog.py8
-rw-r--r--BiblioJAM/JAMDragAndDrop.py2
-rw-r--r--BiblioJAM/JAMEntryText.py4
-rw-r--r--BiblioJAM/JAMFire.py2
-rw-r--r--BiblioJAM/JAMGlobals.py65
-rw-r--r--BiblioJAM/JAMLabel.py6
-rw-r--r--BiblioJAM/JAMNubes.py4
-rw-r--r--BiblioJAM/JAMatrix.py8
-rw-r--r--Main.py6
18 files changed, 94 insertions, 57 deletions
diff --git a/BiblioJAM/JAMBoard.py b/BiblioJAM/JAMBoard.py
index e15fc68..f464e09 100644
--- a/BiblioJAM/JAMBoard.py
+++ b/BiblioJAM/JAMBoard.py
@@ -11,6 +11,8 @@ import pygame, gc, sys
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMBoardTypes import JAMBoardTypes
@@ -18,7 +20,7 @@ class JAMBoard(pygame.sprite.OrderedUpdates):
def __init__(self):
pygame.sprite.OrderedUpdates.__init__(self)
- self.tipo_buttons= "rectangulo"
+ self.tipo_buttons= _("rectangle")
self.posicion= (0,0)
self.text_buffer= ""
@@ -401,7 +403,7 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
diff --git a/BiblioJAM/JAMBoardEntryText.py b/BiblioJAM/JAMBoardEntryText.py
index e845717..2b3fc86 100644
--- a/BiblioJAM/JAMBoardEntryText.py
+++ b/BiblioJAM/JAMBoardEntryText.py
@@ -11,6 +11,8 @@ import pygame, gc, sys, tempfile
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMBoard import JAMBoard
from JAMEntryText import JAMEntryText
@@ -305,7 +307,7 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
diff --git a/BiblioJAM/JAMBoardTypes.py b/BiblioJAM/JAMBoardTypes.py
index a3ba06e..97427d5 100644
--- a/BiblioJAM/JAMBoardTypes.py
+++ b/BiblioJAM/JAMBoardTypes.py
@@ -11,6 +11,8 @@ import pygame, gc, sys
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMLabel import JAMLabel
from JAMButton import JAMButton
@@ -301,7 +303,7 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
diff --git a/BiblioJAM/JAMBook.py b/BiblioJAM/JAMBook.py
index f01e993..c5efcfa 100644
--- a/BiblioJAM/JAMBook.py
+++ b/BiblioJAM/JAMBook.py
@@ -12,6 +12,8 @@ from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
from JAMLabel import JAMLabel
from JAMButton import JAMButton
@@ -176,7 +178,7 @@ class Ejemplo(object):
# Variables obligatorias en tu juego para poder utilizar JAMatrix.
self.resolucion = (1200,800)
self.ventana = None
- self.name= "Ejemplo JAMBook"
+ self.name= _("Example JAMBook")
self.estado = False
# Variables del juego
@@ -231,7 +233,7 @@ class Ejemplo(object):
self.jambook= JAMBook(TEXTO)
self.jambook.set_callback_cerrar(self.salir)
- pygame.display.set_caption("Ejemplo de JAMBook")
+ pygame.display.set_caption(_("Example of JAMBook"))
pygame.event.set_blocked([JOYAXISMOTION, JOYBALLMOTION, JOYHATMOTION, JOYBUTTONUP, JOYBUTTONDOWN,
KEYUP, USEREVENT, QUIT, ACTIVEEVENT])
pygame.event.set_allowed([MOUSEMOTION, MOUSEBUTTONUP, MOUSEBUTTONDOWN, KEYDOWN, VIDEORESIZE, VIDEOEXPOSE])
diff --git a/BiblioJAM/JAMButton.py b/BiblioJAM/JAMButton.py
index b302d51..71d3d28 100644
--- a/BiblioJAM/JAMButton.py
+++ b/BiblioJAM/JAMButton.py
@@ -11,6 +11,8 @@ import pygame, gc, sys
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMLabel import JAMLabel
@@ -526,12 +528,12 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
self.widgets = pygame.sprite.OrderedUpdates()
- self.widgets.add(JAMButton("JAMButton Prueba", None, tipo="elipse"))
+ self.widgets.add(JAMButton(_("Try JAMButton"), None, tipo="elipse"))
self.ventana = pygame.display.get_surface()
self.reloj = pygame.time.Clock()
diff --git a/BiblioJAM/JAMCalendar.py b/BiblioJAM/JAMCalendar.py
index 1fefa1c..8213de8 100644
--- a/BiblioJAM/JAMCalendar.py
+++ b/BiblioJAM/JAMCalendar.py
@@ -12,6 +12,8 @@ from pygame.locals import *
gc.enable()
pygame.font.init()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMButton import JAMButton
from JAMLabel import JAMLabel
@@ -748,7 +750,7 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
self.widgets = JAMCalendar()
#self.widgets.set_posicion(punto= (50,50))
diff --git a/BiblioJAM/JAMClock.py b/BiblioJAM/JAMClock.py
index 7719586..e58dfd3 100644
--- a/BiblioJAM/JAMClock.py
+++ b/BiblioJAM/JAMClock.py
@@ -12,6 +12,8 @@ from pygame.locals import *
gc.enable()
pygame.font.init()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMButton import JAMButton
@@ -355,7 +357,7 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
self.widgets = JAMClock()
self.widgets.set_posicion(punto= (50,50))
diff --git a/BiblioJAM/JAMComboBox.py b/BiblioJAM/JAMComboBox.py
index b0ec196..15fc47e 100644
--- a/BiblioJAM/JAMComboBox.py
+++ b/BiblioJAM/JAMComboBox.py
@@ -12,6 +12,8 @@ from pygame.locals import *
gc.enable()
pygame.font.init()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMButton import JAMButton
@@ -338,9 +340,9 @@ class Ejemplo(object):
self.fondo = self.get_Fondo()
self.widgets = JAMComboBox()
- self.widgets.add_item("Salir", callback= self.salir)
- self.widgets.add_item("Prueba de Item 1", callback= None)
- self.widgets.add_item("Ultima Prueba de Item", callback= None)
+ self.widgets.add_item(_("Leave"), callback= self.salir)
+ self.widgets.add_item(_("Test Item 1"), callback= None)
+ self.widgets.add_item(_("Last Test Item"), callback= None)
self.widgets.set_posicion(punto= (50,50))
self.ventana = pygame.display.get_surface()
diff --git a/BiblioJAM/JAMCron.py b/BiblioJAM/JAMCron.py
index 594a2e1..04c298e 100644
--- a/BiblioJAM/JAMCron.py
+++ b/BiblioJAM/JAMCron.py
@@ -11,6 +11,8 @@ import pygame, gc, sys, time, os
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMButton import JAMButton
@@ -168,7 +170,7 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo de JAMCron")
+ pygame.display.set_caption(_("Example of JAMCron"))
self.fondo = self.get_Fondo()
self.widgets = JAMCron()
diff --git a/BiblioJAM/JAMDialog.py b/BiblioJAM/JAMDialog.py
index c3cec16..f0e310b 100644
--- a/BiblioJAM/JAMDialog.py
+++ b/BiblioJAM/JAMDialog.py
@@ -11,6 +11,8 @@ import pygame, gc, sys
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMLabel import JAMLabel
from JAMButton import JAMButton
@@ -243,7 +245,7 @@ class Ejemplo(object):
self.fondo = self.get_Fondo()
- self.widgets = JAMDialog(mensaje="Prueba JAMDialog", funcion_ok=None, funcion_cancel=None)
+ self.widgets = JAMDialog(mensaje=_("Test JAMDialog"), funcion_ok=None, funcion_cancel=None)
self.widgets.connect(funcion_ok=self.salir, funcion_cancel=self.salir)
self.ventana = pygame.display.get_surface()
@@ -305,7 +307,7 @@ class Ejemplo(object):
color = random.choice(colores)
self.widgets.set_text(tipo=None, tamanio=None, color=color, texto=None)
if modificar == "texto":
- textos= ["JAMLabel", "Presiona escape cuando quieras salir", "Modificando Texto en JAMLabel", "CeibalJAM 2011"]
+ textos= ["JAMLabel", _("Press escape to leave anytime"), _("Modifying Text in JAMLabel"), "CeibalJAM 2011"]
texto = random.choice(textos)
self.widgets.set_text(tipo=None, tamanio=None, color=None, texto=texto)
return 0
@@ -371,7 +373,7 @@ class Ejemplo(object):
color = random.choice(colores)
self.widgets.set_text_buttons(color=color)
if modificar == "texto":
- textos= ["JAMLabel", "Presiona escape cuando quieras salir", "Modificando Texto en JAMLabel", "CeibalJAM 2011"]
+ textos= ["JAMLabel", _("Press escape to leave anytime"), _("Modifying Text in JAMLabel"), "CeibalJAM 2011"]
texto = random.choice(textos)
self.widgets.set_text_buttons(textoaceptar=texto, textocancelar=texto)
return 0
diff --git a/BiblioJAM/JAMDragAndDrop.py b/BiblioJAM/JAMDragAndDrop.py
index 7134cd1..7c6fe87 100644
--- a/BiblioJAM/JAMDragAndDrop.py
+++ b/BiblioJAM/JAMDragAndDrop.py
@@ -11,6 +11,8 @@ import pygame, gc, sys
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
class JAMDragAndDrop():
diff --git a/BiblioJAM/JAMEntryText.py b/BiblioJAM/JAMEntryText.py
index 47dc2da..659154d 100644
--- a/BiblioJAM/JAMEntryText.py
+++ b/BiblioJAM/JAMEntryText.py
@@ -12,6 +12,8 @@ from pygame.locals import *
gc.enable()
pygame.font.init()
+from gettext import gettext as _
+
import JAMGlobals as VG
from JAMLabel import JAMLabel
@@ -417,7 +419,7 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
diff --git a/BiblioJAM/JAMFire.py b/BiblioJAM/JAMFire.py
index fc60983..c4389e5 100644
--- a/BiblioJAM/JAMFire.py
+++ b/BiblioJAM/JAMFire.py
@@ -11,6 +11,8 @@ import pygame, gc, sys, os
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
class JAMFire(pygame.sprite.OrderedUpdates):
diff --git a/BiblioJAM/JAMGlobals.py b/BiblioJAM/JAMGlobals.py
index eda39b0..766f6e9 100644
--- a/BiblioJAM/JAMGlobals.py
+++ b/BiblioJAM/JAMGlobals.py
@@ -11,6 +11,9 @@ import pygame, gc, sys, os, platform
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
+
'''
if "olpc" in platform.platform():
os.environ['SDL_AUDIODRIVER'] = 'alsa'
@@ -276,45 +279,45 @@ def get_calendar(mes, anio):
def get_abrevia_mes(numero):
''' Recibe un entero de 1 a 12 y devuelve la abreviación del mes correspondiente.'''
numero= int(numero)
- if numero== 1: return "ene"
- if numero== 2: return "feb"
- if numero== 3: return "mar"
- if numero== 4: return "abr"
- if numero== 5: return "may"
- if numero== 6: return "jun"
- if numero== 7: return "jul"
- if numero== 8: return "ago"
- if numero== 9: return "sep"
- if numero== 10: return "oct"
- if numero== 11: return "nov"
- if numero== 12: return "dic"
+ if numero== 1: return _("jan")
+ if numero== 2: return _("feb")
+ if numero== 3: return _("mar")
+ if numero== 4: return _("apr")
+ if numero== 5: return _("may")
+ if numero== 6: return _("jun")
+ if numero== 7: return _("jul")
+ if numero== 8: return _("aug")
+ if numero== 9: return _("sep")
+ if numero== 10: return _("oct")
+ if numero== 11: return _("nov")
+ if numero== 12: return _("dec")
def get_mes(numero):
''' Recibe un entero de 1 a 12 y devuelve el nombre del mes correspondiente.'''
numero= int(numero)
- if numero== 1: return "Enero"
- if numero== 2: return "Febrero"
- if numero== 3: return "Marzo"
- if numero== 4: return "Abril"
- if numero== 5: return "Mayo"
- if numero== 6: return "Junio"
- if numero== 7: return "Julio"
- if numero== 8: return "Agosto"
- if numero== 9: return "Setiembre"
- if numero== 10: return "Octubre"
- if numero== 11: return "Noviembre"
- if numero== 12: return "Diciembre"
+ if numero== 1: return _("January")
+ if numero== 2: return _("February")
+ if numero== 3: return _("March")
+ if numero== 4: return _("April")
+ if numero== 5: return _("May")
+ if numero== 6: return _("June")
+ if numero== 7: return _("July")
+ if numero== 8: return _("August")
+ if numero== 9: return _("September")
+ if numero== 10: return _("October")
+ if numero== 11: return _("November")
+ if numero== 12: return _("December")
def get_dia(numero):
''' Recibe un entero de 1 a 7 y devuelve el nombre del día correspondiente.'''
numero= int(numero)
- if numero== 1: return "Lunes"
- if numero== 2: return "Martes"
- if numero== 3: return "Miercoles"
- if numero== 4: return "Jueves"
- if numero== 5: return "Viernes"
- if numero== 6: return "Sabado"
- if numero== 7: return "Domingo"
+ if numero== 1: return _("Monday")
+ if numero== 2: return _("Tuesday")
+ if numero== 3: return _("Wednesday")
+ if numero== 4: return _("Thursday")
+ if numero== 5: return _("Friday")
+ if numero== 6: return _("Saturday")
+ if numero== 7: return _("Sunday")
# Efectos
def get_fire():
diff --git a/BiblioJAM/JAMLabel.py b/BiblioJAM/JAMLabel.py
index 7f5c7ef..4728d87 100644
--- a/BiblioJAM/JAMLabel.py
+++ b/BiblioJAM/JAMLabel.py
@@ -13,6 +13,8 @@ gc.enable()
pygame.font.init()
import JAMGlobals as VG
+from gettext import gettext as _
+
class JAMLabel(pygame.sprite.Sprite):
def __init__(self, texto):
pygame.sprite.Sprite.__init__(self)
@@ -344,12 +346,12 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
self.widgets = pygame.sprite.OrderedUpdates()
- self.widgets.add(JAMLabel("JAMLabel Prueba"))
+ self.widgets.add(JAMLabel(_("Test JAMLabel")))
self.ventana = pygame.display.get_surface()
self.reloj = pygame.time.Clock()
diff --git a/BiblioJAM/JAMNubes.py b/BiblioJAM/JAMNubes.py
index 0269127..ebaf7be 100644
--- a/BiblioJAM/JAMNubes.py
+++ b/BiblioJAM/JAMNubes.py
@@ -11,6 +11,8 @@ import pygame, gc, sys, random
from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
import JAMGlobals as VG
class JAMNubes(pygame.sprite.OrderedUpdates):
@@ -219,7 +221,7 @@ class Ejemplo(object):
def setup(self):
pygame.init()
pygame.display.set_mode(self.resolucion , 0, 0)
- pygame.display.set_caption("Ejemplo")
+ pygame.display.set_caption(_("Example"))
self.fondo = self.get_Fondo()
self.widgets = JAMNubes(rectangulo= (0,0,1200,400))
self.ventana = pygame.display.get_surface()
diff --git a/BiblioJAM/JAMatrix.py b/BiblioJAM/JAMatrix.py
index 8c0129e..af3c78b 100644
--- a/BiblioJAM/JAMatrix.py
+++ b/BiblioJAM/JAMatrix.py
@@ -10,6 +10,8 @@
import pygame
from pygame.locals import *
+from gettext import gettext as _
+
import gc
gc.enable()
@@ -115,7 +117,7 @@ class JAMatrix():
if not self.fondo:
self.fondo = self.get_fondo(color= VG.get_negro(), tamanio=self.resolucion) # superficie
if not self.etiqueta:
- self.etiqueta = JAMLabel (texto="Cargando %s" % (self.juego.name))
+ self.etiqueta = JAMLabel (texto=_("Loading %s" % (self.juego.name)))
self.etiqueta.set_text(tamanio= 50, color= VG.get_blanco())
if not self.posicion_label:
self.posicion_label = (self.resolucion[0]/2 - self.etiqueta.rect.w/2, self.resolucion[1]/2 - self.etiqueta.rect.h/2)
@@ -159,7 +161,7 @@ class Ejemplo(object):
# Variables obligatorias en tu juego para poder utilizar JAMatrix.
self.resolucion = (800,600)
self.ventana = None
- self.name= "Ejemplo JAMatrix"
+ self.name= _("Example JAMatrix")
self.estado = False
# Variables del juego
@@ -274,7 +276,7 @@ class Ejemplo(object):
self.jamclock2.set_posicion(punto= posicion)
- pygame.display.set_caption("Ejemplo de Carga de un Juego con JAMatrix")
+ pygame.display.set_caption(_("Example Loading a game with JAMatrix"))
pygame.event.set_blocked([JOYAXISMOTION, JOYBALLMOTION, JOYHATMOTION, JOYBUTTONUP, JOYBUTTONDOWN,
KEYUP, USEREVENT, QUIT, ACTIVEEVENT])
pygame.event.set_allowed([MOUSEMOTION, MOUSEBUTTONUP, MOUSEBUTTONDOWN, KEYDOWN, VIDEORESIZE, VIDEOEXPOSE])
diff --git a/Main.py b/Main.py
index 2955a88..3bcb9b2 100644
--- a/Main.py
+++ b/Main.py
@@ -24,6 +24,8 @@ from pygame.locals import *
gc.enable()
+from gettext import gettext as _
+
RESOLUCION = (1200, 900)
BASE= os.path.dirname(__file__)
IMAGENES= os.path.join(BASE, "Imagenes/")
@@ -164,12 +166,12 @@ class Main():
self.mensaje= pygame.sprite.OrderedUpdates()
def selecciona_mensaje_salir(self):
- self.dialog.set_text(texto= "¿ Salir de CantaBichos ?")
+ self.dialog.set_text(texto= _("Going outside CantaBichos?"))
self.dialog.connect(funcion_ok= self.salir, funcion_cancel= self.deselecciona_mensaje)
self.mensaje= self.dialog
def selecciona_mensaje_limite(self):
- self.dialog.set_text(texto= "No puedes Reproducir más de 8 Sonidos a la vez !!")
+ self.dialog.set_text(texto= _("You can not play more than 8 sounds at once!"))
self.dialog.connect(funcion_ok= self.deselecciona_mensaje, funcion_cancel= self.deselecciona_mensaje)
self.mensaje= self.dialog