diff gamelib/main.py @ 479:4ea237bbcef8 1.0.1

Tidy up the i18n changes
author Stefano Rivera <stefano@rivera.za.net>
date Tue, 08 Mar 2011 13:25:20 +0200
parents a9925aaf5f61
children
line wrap: on
line diff
--- a/gamelib/main.py	Tue Mar 08 12:29:14 2011 +0200
+++ b/gamelib/main.py	Tue Mar 08 13:25:20 2011 +0200
@@ -10,6 +10,8 @@
 import os.path
 right_path = os.path.dirname(os.path.dirname(__file__))
 sys.path.insert(0, right_path)
+import gettext
+import locale
 from optparse import OptionParser
 
 import pygame
@@ -23,8 +25,6 @@
 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()
@@ -65,9 +65,11 @@
             # 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")
+
+    locale.setlocale(locale.LC_ALL, "")
+    gettext.bindtextdomain("suspended-sentence", data.filepath('locale'))
+    gettext.textdomain("suspended-sentence")
+
     display =  pygame.display.set_mode(SCREEN, SWSURFACE)
     pygame.display.set_icon(pygame.image.load(
         data.filepath('icons/suspended_sentence24x24.png')))