comparison 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
comparison
equal deleted inserted replaced
14:d9e718bdee41 15:2a13413dcc13
17 ## GNU General Public License for more details. 17 ## GNU General Public License for more details.
18 ## 18 ##
19 ## You should have received a copy of the GNU General Public License 19 ## You should have received a copy of the GNU General Public License
20 ## along with this program. If not, see <http://www.gnu.org/licenses/>. 20 ## along with this program. If not, see <http://www.gnu.org/licenses/>.
21 21
22 # Modules
23 import sys
24 import gettext
25 # pyArq-Presupuestos modules
26 from Generic import globalVars
27 from Generic import win32Locale
28
29 def _take_APPDATA_path():
30 # take path to find mo file
31 _path = sys.path[0]
32 globalVars.path["APPDATA"]= _path
33
22 def _translate(): 34 def _translate():
23 """def translate() 35 """def translate()
24 36
25 Translates the program using gettext module 37 Translates the program using gettext module
26 """ 38 """
27 _app = "pyArq-Presupuestos" 39 _app = "pyArq-Presupuestos"
28 _dir = globalVars.path["APPDATA"] + "/mo/" 40 _dir = globalVars.path["APPDATA"] + "/mo/"
41 if sys.platform == 'win32':
42 win32Locale.check_win32_locale()
29 gettext.install(_app, _dir, unicode=1) 43 gettext.install(_app, _dir, unicode=1)
30 44
31 def _run_gui(): 45 def _run_gui():
32 """def _run_gui 46 """def _run_gui
33 47
34 Shows main window and starts the GTK+ event processing loop. 48 Shows main window and starts the GTK+ event processing loop.
35 """ 49 """
50 from Gtk import gui
36 _window = gui.MainWindow() 51 _window = gui.MainWindow()
37 52
38 # Run pyArq-Presupuestos 53 # Run pyArq-Presupuestos
39 if __name__ == "__main__": 54 if __name__ == "__main__":
40 # Modules 55 _take_APPDATA_path()
41 import gettext
42 import sys
43 from Generic import globalVars
44 # take path to find mo file
45 _path = sys.path[0]
46 globalVars.path["APPDATA"]= _path
47 _translate() 56 _translate()
48 from Gtk import gui
49 _run_gui() 57 _run_gui()