diff options
author | Alan Aguiar <alanjas@hotmail.com> | 2013-04-09 20:45:41 (GMT) |
---|---|---|
committer | Alan Aguiar <alanjas@hotmail.com> | 2013-04-09 20:45:41 (GMT) |
commit | a13ed1ca6318aa82330162f24673a017eadeb9c5 (patch) | |
tree | 0be79a95bb117d57e2ca02369a2509eb4b0a85d3 | |
parent | eb4199b74e2340b61b742afa267f62eb769f76e0 (diff) |
add gettext in some strings
-rwxr-xr-x | cells.py | 32 | ||||
-rwxr-xr-x | pieces.py | 3 | ||||
-rwxr-xr-x | sprites.py | 4 |
3 files changed, 21 insertions, 18 deletions
@@ -26,6 +26,8 @@ from sprites import * from colors import * from random import * +from gettext import gettext as _ + ################################################################################ # Game ################################################################################ @@ -238,22 +240,22 @@ class Game(): self.flashing_text = Group((prompt_text)) def help(self): - a = Text("Try and get 1 of species in the yellow escape area.", - size = int(60)) - b = Text("Click a cell to send the guard there.", - size = int(60)) + a = Text(_("Try and get 1 of species in the yellow escape area."), + size = int(50)) + b = Text(_("Click a cell to send the guard there."), + size = int(50)) b.rect.top = a.rect.bottom + 1 - c = Text("Prisoners can escape iff the adjacent hiding space is", - size = int(60)) + c = Text(_("Prisoners can escape iff the adjacent hiding space is"), + size = int(50)) c.rect.top = b.rect.bottom + 1 - d = Text(" red and empty or green and occupied.", - size = int(60)) + d = Text(' ' + _("red and empty or green and occupied."), + size = int(50)) d.rect.top = c.rect.bottom + 1 - e = Text("Hit 'Esc' to return to the menu.", - size = int(60)) + e = Text(_("Hit 'Esc' to return to the menu."), + size = int(50)) e.rect.top = d.rect.bottom + 1 - f = Text("Press 'r' to reset the current game", - size = int(60)) + f = Text(_("Press 'r' to reset the current game"), + size = int(50)) f.rect.top = e.rect.bottom + 1 text = Group((a, b, c, d, e, f)) @@ -307,9 +309,9 @@ class Game(): if self.cell_count == 9: self.background.fill(black) - text1 = Text("Congratulations", color = white, size = 120) - text2 = Text("You finished in " + str(self.move_count) + - " moves.", color = white, size = 60) + text1 = Text(_("Congratulations"), color = white, size = 120) + text2 = Text(_("You finished in %s moves.") % str(self.move_count), + color = white, size = 60) text2.rect.top = text1.rect.bottom + 10 self.text = Group((text1, text2)) @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with Cells. If not, see <http://www.gnu.org/licenses/>. -import math, pygame +import math +import pygame from pygame.locals import * from sprites import * from colors import * @@ -14,7 +14,8 @@ # You should have received a copy of the GNU General Public License # along with Cells. If not, see <http://www.gnu.org/licenses/>. -import math, pygame +import math +import pygame from pygame.locals import * from colors import * from random import * @@ -211,4 +212,3 @@ class Guard(MovingSprite): else: self.moving = False - |