108 updateinfoThread.start() |
108 updateinfoThread.start() |
109 updateinfoThread.join(2) |
109 updateinfoThread.join(2) |
110 splash.SetText(text=updateinfo) |
110 splash.SetText(text=updateinfo) |
111 wx.Yield() |
111 wx.Yield() |
112 |
112 |
113 # Import module for internationalization |
113 from util.TranslationCatalogs import AddCatalog, locale |
114 import gettext |
114 from util.BitmapLibrary import AddBitmapFolder, GetBitmap |
115 |
115 |
116 # Get folder containing translation files |
116 AddCatalog(os.path.join(CWD, "locale")) |
117 localedir = os.path.join(CWD,"locale") |
117 AddBitmapFolder(os.path.join(CWD, "images")) |
118 # Get the default language |
|
119 langid = wx.LANGUAGE_DEFAULT |
|
120 # Define translation domain (name of translation files) |
|
121 domain = "Beremiz" |
|
122 |
|
123 # Define locale for wx |
|
124 loc = __builtin__.__dict__.get('loc', None) |
|
125 if loc is None: |
|
126 test_loc = wx.Locale(langid) |
|
127 test_loc.AddCatalogLookupPathPrefix(localedir) |
|
128 if test_loc.AddCatalog(domain): |
|
129 loc = wx.Locale(langid) |
|
130 else: |
|
131 loc = wx.Locale(wx.LANGUAGE_ENGLISH) |
|
132 __builtin__.__dict__['loc'] = loc |
|
133 # Define location for searching translation files |
|
134 loc.AddCatalogLookupPathPrefix(localedir) |
|
135 # Define locale domain |
|
136 loc.AddCatalog(domain) |
|
137 |
|
138 def unicode_translation(message): |
|
139 return wx.GetTranslation(message).encode("utf-8") |
|
140 |
118 |
141 if __name__ == '__main__': |
119 if __name__ == '__main__': |
142 __builtin__.__dict__['_'] = wx.GetTranslation#unicode_translation |
120 # Import module for internationalization |
143 |
121 import gettext |
144 from util.BitmapLibrary import AddBitmapFolder, GetBitmap |
122 |
145 AddBitmapFolder(os.path.join(CWD, "images")) |
123 __builtin__.__dict__['loc'] = locale |
146 |
124 __builtin__.__dict__['_'] = wx.GetTranslation |
147 if __name__ == '__main__': |
125 |
148 # Load extensions |
126 # Load extensions |
149 for extfilename in extensions: |
127 for extfilename in extensions: |
150 extension_folder = os.path.split(os.path.realpath(extfilename))[0] |
128 extension_folder = os.path.split(os.path.realpath(extfilename))[0] |
151 sys.path.append(extension_folder) |
129 sys.path.append(extension_folder) |
|
130 AddCatalog(os.path.join(extension_folder, "locale")) |
152 AddBitmapFolder(os.path.join(extension_folder, "images")) |
131 AddBitmapFolder(os.path.join(extension_folder, "images")) |
153 execfile(extfilename, locals()) |
132 execfile(extfilename, locals()) |
154 |
133 |
155 import wx.lib.buttons, wx.lib.statbmp |
134 import wx.lib.buttons, wx.lib.statbmp |
156 import cPickle |
135 import cPickle |