diff pyArq-Presupuestos.py @ 15:2a13413dcc13

gettext on windows
author Miguel Ángel Bárcena Rodríguez <miguelangel@obraencurso.es>
date Sun, 02 Jan 2011 10:27:16 +0100
parents d9e718bdee41
children 65e7ae0d0e63
line wrap: on
line diff
--- a/pyArq-Presupuestos.py	Sat Jan 01 20:09:02 2011 +0100
+++ b/pyArq-Presupuestos.py	Sun Jan 02 10:27:16 2011 +0100
@@ -19,6 +19,18 @@
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+# Modules
+import sys
+import gettext
+# pyArq-Presupuestos modules
+from Generic import globalVars
+from Generic import win32Locale
+
+def _take_APPDATA_path():
+    # take path to find mo file
+    _path = sys.path[0]
+    globalVars.path["APPDATA"]= _path
+
 def _translate():
     """def translate()
     
@@ -26,6 +38,8 @@
     """
     _app = "pyArq-Presupuestos"
     _dir = globalVars.path["APPDATA"] + "/mo/"
+    if sys.platform == 'win32':
+        win32Locale.check_win32_locale()
     gettext.install(_app, _dir, unicode=1)
 
 def _run_gui():
@@ -33,17 +47,11 @@
     
     Shows main window and starts the GTK+ event processing loop.
     """
+    from Gtk import gui
     _window = gui.MainWindow()
 
 # Run pyArq-Presupuestos
 if __name__ == "__main__":
-    # Modules
-    import gettext
-    import sys
-    from Generic import globalVars
-    # take path to find mo file
-    _path = sys.path[0]
-    globalVars.path["APPDATA"]= _path
+    _take_APPDATA_path()
     _translate()
-    from Gtk import gui
     _run_gui()