141 # Define location for searching translation files |
141 # Define location for searching translation files |
142 loc.AddCatalogLookupPathPrefix(localedir) |
142 loc.AddCatalogLookupPathPrefix(localedir) |
143 # Define locale domain |
143 # Define locale domain |
144 loc.AddCatalog(domain) |
144 loc.AddCatalog(domain) |
145 |
145 |
146 |
|
147 import locale |
146 import locale |
148 global default_locale |
147 global default_locale |
149 default_locale = locale.getdefaultlocale()[1] |
148 default_locale = locale.getdefaultlocale()[1] |
150 |
|
151 |
149 |
152 # sys.stdout.encoding = default_locale |
150 # sys.stdout.encoding = default_locale |
153 # if Beremiz_service is started from Beremiz IDE |
151 # if Beremiz_service is started from Beremiz IDE |
154 # sys.stdout.encoding is None (that means 'ascii' encoding'). |
152 # sys.stdout.encoding is None (that means 'ascii' encoding'). |
155 # And unicode string returned by wx.GetTranslation() are |
153 # And unicode string returned by wx.GetTranslation() are |
194 def Bind(self, event, function, id = None): |
192 def Bind(self, event, function, id = None): |
195 if id is not None: |
193 if id is not None: |
196 event(self, id, function) |
194 event(self, id, function) |
197 else: |
195 else: |
198 event(self, function) |
196 event(self, function) |
199 |
|
200 |
197 |
201 def __init__(self, parent, message, caption = _("Please enter text"), defaultValue = "", |
198 def __init__(self, parent, message, caption = _("Please enter text"), defaultValue = "", |
202 style = wx.OK|wx.CANCEL|wx.CENTRE, pos = wx.DefaultPosition): |
199 style = wx.OK|wx.CANCEL|wx.CENTRE, pos = wx.DefaultPosition): |
203 wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) |
200 wx.TextEntryDialog.__init__(self, parent, message, caption, defaultValue, style, pos) |
204 |
201 |