Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorC. Scott Ananian <cscott@laptop.org>2007-12-11 19:32:51 (GMT)
committer C. Scott Ananian <cscott@laptop.org>2007-12-11 19:32:51 (GMT)
commitcef6bbd0952b90d26760f10f7887a34b87849ede (patch)
tree78afecab89e4b6f005b0949f8e60401e13f48f3e /library
parent9df72c5591aee015089a4e96f9403183262dcc01 (diff)
Localize the 'PAUSED' message in the pygame support.
Diffstat (limited to 'library')
-rw-r--r--library/pippy/game.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/library/pippy/game.py b/library/pippy/game.py
index e5996fa..f426c75 100644
--- a/library/pippy/game.py
+++ b/library/pippy/game.py
@@ -3,7 +3,8 @@
import pygame
def pause():
- # display a "Paused" screen and suspend.
+ """Display a "Paused" screen and suspend."""
+ from gettext import gettext as _
caption, icon_caption = pygame.display.get_caption()
screen = pygame.display.get_surface()
old_screen = screen.copy() # save this for later.
@@ -16,7 +17,7 @@ def pause():
screen.fill(WHITE)
screen.blit(dimmed, (0,0))
font = pygame.font.Font(None, 36) # 36px high
- msg = " PAUSED "
+ msg = _("PAUSED")
msg_surf = font.render(msg, True, BLACK, WHITE)
def center(rect, screen):
rect.center = (screen.get_width()/2, screen.get_height()/2)
@@ -41,7 +42,8 @@ def pause():
pygame.display.flip()
_last_event_time=0
-def next_frame(max_fps=20, idle_timeout=20, clock=pygame.time.Clock()):
+def next_frame(max_fps=20, idle_timeout=20,
+ clock=pygame.time.Clock(), pause=pause):
"""Limit maximum frame rate of pygame. Returns True.
If idle longer than the idle_timeout (in seconds), then we'll put up a