comparison gamelib/main.py @ 478:a9925aaf5f61 1.0.1

i18n and Russian translation
author Stefano Rivera <stefano@rivera.za.net>
date Tue, 08 Mar 2011 12:29:14 +0200
parents 9c285017535d
children 4ea237bbcef8
comparison
equal deleted inserted replaced
477:51055400a9a8 478:a9925aaf5f61
21 from endscreen import EndScreen 21 from endscreen import EndScreen
22 from constants import SCREEN, FRAME_RATE, FREQ, BITSIZE, CHANNELS, BUFFER, DEBUG 22 from constants import SCREEN, FRAME_RATE, FREQ, BITSIZE, CHANNELS, BUFFER, DEBUG
23 from sound import no_sound, disable_sound 23 from sound import no_sound, disable_sound
24 import state 24 import state
25 import data 25 import data
26 from locale import setlocale, LC_ALL
27 from gettext import bindtextdomain, textdomain
26 28
27 def parse_args(args): 29 def parse_args(args):
28 parser = OptionParser() 30 parser = OptionParser()
29 parser.add_option("--no-sound", action="store_false", default=True, 31 parser.add_option("--no-sound", action="store_false", default=True,
30 dest="sound", help="disable sound") 32 dest="sound", help="disable sound")
61 if DEBUG: 63 if DEBUG:
62 if opts.scene is not None: 64 if opts.scene is not None:
63 # debug the specified scene 65 # debug the specified scene
64 state.DEBUG_SCENE = opts.scene 66 state.DEBUG_SCENE = opts.scene
65 state.DEBUG_RECTS = opts.rects 67 state.DEBUG_RECTS = opts.rects
68 setlocale(LC_ALL, "")
69 bindtextdomain("suspended-sentence", data.filepath('locale'))
70 textdomain("suspended-sentence")
66 display = pygame.display.set_mode(SCREEN, SWSURFACE) 71 display = pygame.display.set_mode(SCREEN, SWSURFACE)
67 pygame.display.set_icon(pygame.image.load( 72 pygame.display.set_icon(pygame.image.load(
68 data.filepath('icons/suspended_sentence24x24.png'))) 73 data.filepath('icons/suspended_sentence24x24.png')))
69 pygame.display.set_caption("Suspended Sentence") 74 pygame.display.set_caption("Suspended Sentence")
70 shell = MainShell(display) 75 shell = MainShell(display)