diff options
Diffstat (limited to 'crazyeights.py')
-rwxr-xr-x | crazyeights.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/crazyeights.py b/crazyeights.py index 24a5328..dc7fefd 100755 --- a/crazyeights.py +++ b/crazyeights.py @@ -32,6 +32,8 @@ import pygame import pygame.font from pygame.locals import * +from gettext import gettext as _ + import run LOCALPLAYER = 0 @@ -46,7 +48,7 @@ class player(fiftytwo.cardgroup): """ def __init__(self, position): fiftytwo.cardgroup.__init__(self, (), position[0], position[1]) - self.name = "Unnamed" + self.name = _("Unnamed") self.number = 0 def next_turn(self, topcardid): @@ -168,7 +170,7 @@ def prev_turn(players, whosturn): def choose_suit(player, choosesuitimage, discard): screen = pygame.display.get_surface() font = pygame.font.Font(None, 28) - text = font.render("Choose a suit", 1, (0, 255, 255)) + text = font.render(_("Choose a suit"), 1, (0, 255, 255)) screen.fill((128, 64, 64), ((50, 50), (200, 200))) @@ -176,7 +178,11 @@ def choose_suit(player, choosesuitimage, discard): while 1: fpslimiter.tick(20) - for event in pausescreen.get_events(): + + while gtk.events_pending(): + gtk.main_iteration() + + for event in pygame.event.get(): if event.type == QUIT: return elif event.type == MOUSEBUTTONDOWN: @@ -266,7 +272,7 @@ def main(playertypes, screensize): font = pygame.font.Font(None, 48) - loading = font.render("Loading, please wait!", 1, (255, 255, 255)) + loading = font.render(_("Loading, please wait!"), 1, (255, 255, 255)) screen.blit(loading, (450, 350)) @@ -344,8 +350,9 @@ def main(playertypes, screensize): for x in players: if len(x.sprites()) == 0: screen.fill(BGCOL) - gameover = font.render("Game over,", 1, (0, 255, 255)) - message = font.render(x.name + " won the game!", 1, (255, 255, 0)) + gameover = font.render(_("Game over,"), 1, (0, 255, 255)) + m = _('%s won the game!') + message = font.render(m % x.name, 1, (255, 255, 0)) for p in players: p.set_all_faces(UP) |