diff 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
line wrap: on
line diff
--- a/gamelib/main.py	Sun Aug 29 12:33:21 2010 +0200
+++ b/gamelib/main.py	Tue Mar 08 12:29:14 2011 +0200
@@ -23,6 +23,8 @@
 from sound import no_sound, disable_sound
 import state
 import data
+from locale import setlocale, LC_ALL
+from gettext import bindtextdomain, textdomain
 
 def parse_args(args):
     parser = OptionParser()
@@ -63,6 +65,9 @@
             # debug the specified scene
             state.DEBUG_SCENE = opts.scene
         state.DEBUG_RECTS = opts.rects
+    setlocale(LC_ALL, "")
+    bindtextdomain("suspended-sentence", data.filepath('locale'))
+    textdomain("suspended-sentence")
     display =  pygame.display.set_mode(SCREEN, SWSURFACE)
     pygame.display.set_icon(pygame.image.load(
         data.filepath('icons/suspended_sentence24x24.png')))