Internationalizationhttp://www.zetcode.com/wxpython/in18/import wxtext = u'\u041b\u0435\u0432 \u041d\u0438\u043a\u043e\u043b\u0430\\u0435\u0432\u0438\u0447 \u0422\u043e\u043b\u0441\u0442\u043e\u0439 \n\\u0410\u043d\u043d\u0430 \u041a\u0430\u0440\u0435\u043d\u0438\u043d\u0430'class Unicode(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(250, 150))self.Bind(wx.EVT_PAINT, self.OnPaint)self.Centre()self.Show(True)def OnPaint(self, event):dc = wx.PaintDC(self)dc.DrawText(text, 50, 50)app = wx.App()Unicode(None, -1, 'Unicode')app.MainLoop()In the example, we draw Anna Karenina in russian azbuka on thewindow.Figure: UnicodeLocaleA locale is an object that defines user's language, country,number format, letter format, currency format etc. A localvariant has the following format.[language[_territory][.codeset][@modifier]]2 de 12 27/04/2008 1:06
Internationalizationhttp://www.zetcode.com/wxpython/in18/For example, de_AT.utf8 is a german local used in Austria, withUTF8 codeset.#!/usr/bin/python# locale.pyimport wximport timeimport localeclass Locale(wx.Frame):def __init__(self, parent, id, title):wx.Frame.__init__(self, parent, id, title, size=(250, 420))panel = wx.Panel(self, -1)tm = time.localtime()font = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)us = wx.StaticText(self, -1, 'United States', (25, 20))us.SetFont(font)wx.StaticLine(self, -1, (25, 50), (200 ,1))locale.setlocale(locale.LC_ALL, '')date = time.strftime('%x', tm)time_ = time.strftime('%X', tm)curr = locale.currency(100000)wx.StaticText(self, -1, 'date: ', (25, 70))wx.StaticText(self, -1, 'time: ', (25, 90))wx.StaticText(self, -1, 'currency: ', (25, 110))wx.StaticText(self, -1, str(date), (125, 70))wx.StaticText(self, -1, str(time_), (125, 90))wx.StaticText(self, -1, str(curr), (125, 110))de = wx.StaticText(self, -1, 'Germany', (25, 150))de.SetFont(font)wx.StaticLine(self, -1, (25, 180), (200,1))locale.setlocale(locale.LC_ALL, ('de_DE', 'UTF8'))date = time.strftime('%x', tm)time_ = time.strftime('%X', tm)curr = locale.currency(100000)wx.StaticText(self, -1, 'date: ', (25, 200))wx.StaticText(self, -1, 'time: ', (25, 220))wx.StaticText(self, -1, 'currency: ', (25, 240))wx.StaticText(self, -1, date, (125, 200))wx.StaticText(self, -1, time_, (125, 220))wx.StaticText(self, -1, curr, (125, 240))3 de 12 27/04/2008 1:06