Commits

wbruhin  committed 17d1a2c

- I18N support - run tools.genpot.py after pulling this one, see wiki entry

  • Participants
  • Parent commits 8af4e78

Comments (0)

Files changed (21)

 .DS_Store
 data/devdata.sqlite
 mlsrc.egg-info/
+mlsrc/locale/de/LC_MESSAGES/*.mo

File mlsrc/base_app.py

 logging.basicConfig(format=format, level=logging.ERROR)
 
 import os
+import sys
+import locale
+
+# I18N
+# gettext will install "_" into global namespace
+import gettext
+basedir, f = os.path.split(__file__)
+localeDir = os.path.join(basedir, 'locale')
+locale.setlocale(locale.LC_ALL, '')
+gettext.install('medialocker', localeDir, unicode=True)
+
+# Install a custom displayhook to keep Python from setting the global
+# _ (underscore) to the value of the last evaluated expression.  If
+# we don't do this, our mapping of _ to gettext can get overwritten.
+# This is useful/needed in interactive debugging with PyShell.
+
+def _displayHook(obj):
+    if obj is not None:
+        print repr(obj)
 
 import wxversion
 try:
 
 import wx
 logging.debug("wxV: %s\n\n" % wx.VERSION_STRING)
+# I18N
+wx.Locale.AddCatalogLookupPathPrefix(localeDir)
 
 import wx.lib.mixins.inspection as wit
 
 class BaseApp(wx.App, wit.InspectionMixin):
     def OnInit(self):
         self.Init() # WIT
-        
+
+        # work around for Python stealing "_"
+        sys.displayhook = _displayHook
+
         self._dataNeedsSaving = False
         self.baseDir, f = os.path.split(__file__)
         # data folder is one level up
         logging.debug("db: %s\n\n" % dbUrl)
 
         self.session = self.connectToDatabase(dbUrl)
+        
+        self.doAppConfig()
 
         return True
 
     #----------------------------------------------------------------------
+    def doAppConfig(self):
+        """
+        Get application configuration from file
+        """
+        appName = "MediaLocker"
+        # configuration folder
+        sp = wx.StandardPaths.Get()
+        configLoc = sp.GetUserConfigDir()
+        configLoc = os.path.join(configLoc, appName)
+        # win: C:\Users\userid\AppData\Roaming\MediaLocker
+        # nix: \home\userid\MediaLocker
+        if not os.path.exists(configLoc):
+            os.mkdir(configLoc)
+        
+        logging.debug(configLoc)
+        
+        appConfig = wx.FileConfig(appName=appName,
+                                  vendorName=u'Mike and Werner',
+                                  localFilename=os.path.join(
+                                            configLoc, "AppConfig"))
+        if not appConfig.HasEntry('Language'):
+            appConfig.Write(key=u'Language', value=u'en')
+
+        self.doLangSetup(appConfig.Read('Language'))
+
+   #----------------------------------------------------------------------
+    def doLangSetup(self, ulang):
+        """
+        do gettext and wx setup for requested language
+        
+        
+        
+        :param ulang: The two character language code
+        """
+        # check that ulang is a supported language, currently just "de"
+        if ulang in ["de", ]:
+            if ulang == "de":
+                langde = gettext.translation('medialocker',
+                                             localeDir,
+                                             languages=['de'])
+                langde.install(unicode=True)
+                # Make *sure* any existing locale is deleted before the new
+                # one is created.  The old C++ object needs to be deleted
+                # before the new one is created, and if we just assign a new
+                # instance to the old Python variable, the old C++ locale will
+                # not be destroyed soon enough, likely causing a crash.
+                if hasattr(self, 'wxLocale'):
+                    assert sys.getrefcount(self.wxLocale) <= 2
+                    del self.wxLocale
+                
+                self.wxLocale = wx.Locale(wx.LANGUAGE_GERMAN)
+                if self.wxLocale.IsOk():
+                    self.wxLocale.AddCatalog('medialocker')
+                else:
+                    self.wxLocale = None
+                
+    #----------------------------------------------------------------------
     def connectToDatabase(self, dburl):
         """
         Connect to our database and return a Session object
         the changes they made
         """
         if self._dataNeedsSaving:
-            msg = _(u'You entered data which is not saved!\n\nClick on "No" to return and save it\n\nor on "Yes" to quit and lose it!')
-            caption = _(u'Unsaved data warning!')
+            msg = _(u"You entered data which is not saved!\n\nClick on 'No' to return and save it\n\nor on 'Yes' to quit and lose it!")
+            caption = _(u"Unsaved data warning!")
             dlg = wx.MessageDialog(None, msg, caption,
                                 wx.YES_NO | wx.NO_DEFAULT | wx.ICON_EXCLAMATION)
             try:

File mlsrc/controllers/base_addedit.py

 
 from mlsrc.mypub import pub, pTopics
 
-# needs to be changed to fully support i18n
-_ = wx.GetTranslation
 
 ########################################################################
 class BaseAE(cBase.BaseController):
     def __init__(self, parent, view=None, model=None,
-                 row=None, title="Add", addModus=True, **kwds):
+                 row=None, title=_(u"Add"), addModus=True, **kwds):
         """Constructor for BaseAE controller 
 
         :param parent: caller
         """
         btnSizer = wx.BoxSizer(wx.HORIZONTAL)
 
-        okBtn = wx.Button(self.view, label="%s - %s" % (self.modusTitle,
-                                                        self.baseTitle))
+        okBtn = wx.Button(self.view, label=_(
+                                        u"%(modTitle)s - %(baseTitle)s") % (
+                                        {'modTitle': self.modusTitle,
+                                         'baseTitle': self.baseTitle}))
         okBtn.Bind(wx.EVT_BUTTON, self.onRecord)
         btnSizer.Add(okBtn, 0, wx.ALL, 5)
-        cancelBtn = wx.Button(self.view, label="Close")
+        cancelBtn = wx.Button(self.view, label=_(u"Close"))
         cancelBtn.Bind(wx.EVT_BUTTON, self.onCloseButton)
         btnSizer.Add(cancelBtn, 0, wx.ALL, 5)
 
         self.view.TransferDataFromWindow()
         if not self.validateControls():
             return False
-        self.addRecord(self.dbItem)
-        logging.debug(self)
+        logging.debug(self.dbItem)
         pub.sendMessage(pTopics.data.itemAdded, dbparent=self,
                                                 dbitem=self.dbItem)
+        self.addRecord(self.dbItem)
         # reset db item and clear controls
         self.dbItem = None
         self.view.TransferDataToWindow()
         "Edit" the existing one based on the addModus parameter.
         
         """
+        logging.debug(self._AddModus)
         if self._AddModus:
             self.onAdd()
         else:

File mlsrc/controllers/base_list.py

         font = wx.Font(10, wx.SWISS, wx.NORMAL, wx.BOLD)
 
         # create the search related widgets
-        cat = ["Default", ]
-        searchByLbl = wx.StaticText(self.view, label="Search By:")
+        cat = [("Default", "Default"), ]
+        searchByLbl = wx.StaticText(self.view, label=_(u"Search By:"))
         searchByLbl.SetFont(font)
         searchSizer.Add(searchByLbl, 0, wx.ALL, 5)
 
-        self.categories = wx.ComboBox(self.view, value="Default", choices=cat)
+        self.categories = wx.ComboBox(self.view, value="", choices=[])
         searchSizer.Add(self.categories, 0, wx.ALL, 5)
 
         self.search = wx.SearchCtrl(self.view, style=wx.TE_PROCESS_ENTER)
                                        parent=self.view, style=wx.TAB_TRAVERSAL)
 
         # create the button row
-        addRecordBtn = wx.Button(self.view, label="Add")
+        addRecordBtn = wx.Button(self.view, label=_(u"Add"))
         addRecordBtn.Bind(wx.EVT_BUTTON, self.onAddRecord)
         btnSizer.Add(addRecordBtn, 0, wx.ALL, 5)
 
-        editRecordBtn = wx.Button(self.view, label="Edit")
+        editRecordBtn = wx.Button(self.view, label=_(u"Edit"))
         editRecordBtn.Bind(wx.EVT_BUTTON, self.onEditRecord)
         btnSizer.Add(editRecordBtn, 0, wx.ALL, 5)
 
-        deleteRecordBtn = wx.Button(self.view, label="Delete")
+        deleteRecordBtn = wx.Button(self.view, label=_(u"Delete"))
         deleteRecordBtn.Bind(wx.EVT_BUTTON, self.onDelete)
         btnSizer.Add(deleteRecordBtn, 0, wx.ALL, 5)
 
-        showAllBtn = wx.Button(self.view, label="Show All")
+        showAllBtn = wx.Button(self.view, label=_(u"Show All"))
         showAllBtn.Bind(wx.EVT_BUTTON, self.onShowAllRecord)
         btnSizer.Add(showAllBtn, 0, wx.ALL, 5)
 
         :param scats: list of search categories
         """
         self.categories.Clear()
-        self.categories.AppendItems(scats)
+        for cat in scats:
+            self.categories.Append(cat[0], cat[1])
         self.categories.SetSelection(0)
         
         # setup list and load list objects
         :param dbitem: an SA instance
         
         """
-        # protect from PyDeadObjectError
-        if self:
-            if isinstance(dbitem, getattr(db, self.modelName)):
-                self.theOlv.getList().AddObject(dbitem)
+        logging.debug(dbitem)
+        logging.debug(self.modelName)
+        if isinstance(dbitem, getattr(db, self.modelName)):
+            self.theOlv.getList().AddObject(dbitem)
 
     #----------------------------------------------------------------------
     def onItemModified(self, dbparent, dbitem):
         :param dbitem: an SA instance
         
         """
-        # protect from PyDeadObjectError
-        if self:
-            if isinstance(dbitem, getattr(db, self.modelName)):
-                self.theOlv.getList().RefreshObject(dbitem)
+        logging.debug(dbitem)
+        logging.debug(self.modelName)
+        if isinstance(dbitem, getattr(db, self.modelName)):
+            self.theOlv.getList().RefreshObject(dbitem)
 
     #----------------------------------------------------------------------
     def onDelete(self, event):
         """
         Searches database based on the user's filter choice and keyword.
         """
-        filterChoice = self.categories.GetValue()
+        catCtrl = self.categories
+        filterChoice = catCtrl.GetClientData(catCtrl.GetSelection())
         keyword = self.search.GetValue()
         logging.debug("%s %s" % (filterChoice, keyword))
         self.listObjects = self.searchRecords(filterChoice, keyword)

File mlsrc/controllers/d_book.py

 
 import mlsrc.models as db
 
-# needs to be changed to fully support i18n
-_ = wx.GetTranslation
-
-
 ########################################################################
 class Book(BaseAE):
-    def __init__(self, parent, row=None, title="Add", addModus=True, **kwds):
+    def __init__(self, parent, row=None, title=_(u"Add"), addModus=True, **kwds):
         """Constructor for Book controller 
 
         :param parent: caller
         """
         self.view = wx.Dialog(parent, wx.ID_ANY,
               style=wx.DEFAULT_DIALOG_STYLE,
-              title="%s Record" % title)
+              title=_(u"%s Record") % title)
         self.view.SetName("dlgBook")
         super(Book, self).__init__(parent, view=self.view, model="Book",
-                                     row=None, title="Add", addModus=True,
+                                     row=None, title=_(u"Add"), addModus=True,
                                      **kwds)
 
         self.baseTitle = "Book"
         self.dbItem = row
 
         # create some widgets
-        lbl = wx.StaticText(self.view, label="%s Record" % title)
+        lbl = wx.StaticText(self.view, label=_(u"%s Record") % title)
         lbl.SetFont(wx.Font(dlgFontHeader, dlgFontFam, wx.NORMAL, wx.BOLD))
         self.dlgSizer.Add(lbl, 0, wx.CENTER)
 
         stFont = wx.Font(dlgFontSt, dlgFontFam, wx.NORMAL, wx.BOLD)
 
-        titleLbl = wx.StaticText(self.view, label="Title:")
+        titleLbl = wx.StaticText(self.view, label=_(u"Title:"))
         titleLbl.SetFont(stFont)
         self.titleTxt = tcs.TextCtrl(self.view)
         self.titleTxt.dbParent = self
         self.titleTxt.SetValidator(validators.ValTC())
         self.rowBuilder([titleLbl, self.titleTxt])
 
-        authorLbl = wx.StaticText(self.view, label="Author:")
+        authorLbl = wx.StaticText(self.view, label=_(u"Author:"))
         authorLbl.SetFont(stFont)
 
         ctrls = [{'cType': 'sc', 'desc': _(u"Author"),
         self.authorSc.Enable(True)
         self.rowBuilder([authorLbl, self.authorSc])
 
-        isbnLbl = wx.StaticText(self.view, label="ISBN:")
+        isbnLbl = wx.StaticText(self.view, label=_(u"ISBN:"))
         isbnLbl.SetFont(stFont)
         self.isbnTxt = tcs.TextCtrl(self.view)
         self.isbnTxt.dbParent = self
         self.isbnTxt.SetValidator(validators.ValTC())
         self.rowBuilder([isbnLbl, self.isbnTxt])
 
-        publisherLbl = wx.StaticText(self.view, label="Publisher:")
+        publisherLbl = wx.StaticText(self.view, label=_(u"Publisher:"))
         publisherLbl.SetFont(stFont)
         ctrls = [{'cType': 'sc', 'desc': _(u"Publisher"),
                         'dbColName': 'name',

File mlsrc/controllers/d_person.py

 
 from mlsrc.app_constants import *
 
-# needs to be changed to fully support i18n
-_ = wx.GetTranslation
-
 ########################################################################
 class Person(BaseAE):
     def __init__(self, parent, row=None, title="Add", addModus=True, **kwds):
         """
         self.view = wx.Dialog(parent, wx.ID_ANY,
               style=wx.DEFAULT_DIALOG_STYLE,
-              title="%s Record" % title)
+              title=_(u"%s - Record") % title)
         self.view.SetName("dlgPerson")
         super(Person, self).__init__(parent, view=self.view, model="Person",
-                                     row=None, title="Add", addModus=True,
+                                     row=None, title=_(u"Add"), addModus=True,
                                      **kwds)
 
-        self.baseTitle = "Person"
+        self.baseTitle = _(u"Person")
         self.modusTitle = title
 
         self._AddModus = addModus
         self.dbItem = row
 
         # create some widgets
-        lbl = wx.StaticText(self.view, label="%s Record" % title)
+        lbl = wx.StaticText(self.view, label=_(u"%s - Record") % title)
         lbl.SetFont(wx.Font(dlgFontHeader, dlgFontFam, wx.NORMAL, wx.BOLD))
         self.dlgSizer.Add(lbl, 0, wx.CENTER)
 
         stFont = wx.Font(dlgFontSt, dlgFontFam, wx.NORMAL, wx.BOLD)
 
-        firstLbl = wx.StaticText(self.view, label="First name:")#, size=size)
+        firstLbl = wx.StaticText(self.view, label=_(u"First name:"))#, size=size)
         firstLbl.SetFont(stFont)
         self.firstTxt = tcs.TextCtrl(self.view)
         self.firstTxt.dbParent = self
         self.firstTxt.SetValidator(validators.ValTC())
         self.rowBuilder([firstLbl, self.firstTxt])
 
-        lastLbl = wx.StaticText(self.view, label="Last name:")#, size=size)
+        lastLbl = wx.StaticText(self.view, label=_(u"Last name:"))#, size=size)
         lastLbl.SetFont(stFont)
         self.lastTxt = tcs.TextCtrl(self.view)
         self.lastTxt.dbParent = self

File mlsrc/controllers/d_persons.py

         """
         self.view = wx.Dialog(parent, wx.ID_ANY,
               style=wx.DEFAULT_DIALOG_STYLE,
-              title="Maintain person information")
+              title=_(u"Maintain person information"))
         self.view.SetName("dPersons")
         super(Persons, self).__init__(view=self.view, model="Person", **kwds)
 
-        scats = ["Person", ]
+        scats = [(_(u"Person"), "Person"), ]
         self.initDlgListBase(scats)
 
     #----------------------------------------------------------------------
         """
         selectedRow = self.theOlv.getList().GetSelectedObject()
         if selectedRow == None:
-            commonDlgs.showMessageDlg("No row selected!", "Error")
+            commonDlgs.showMessageDlg(_(u"No row selected!"), _(u"Error"))
             return
-        dlg = dPerson.Person(self.view, selectedRow, title="Modify",
+        dlg = dPerson.Person(self.view, selectedRow, title=_(u"Modify"),
                                                  addModus=False).view
         dlg.ShowModal()
         dlg.Destroy()

File mlsrc/controllers/d_publisher.py

 
 from mlsrc.app_constants import *
 
-# needs to be changed to fully support i18n
-_ = wx.GetTranslation
 
 ########################################################################
 class Publisher(BaseAE):
-    def __init__(self, parent, row=None, title="Add", addModus=True, **kwds):
+    def __init__(self, parent, row=None, title=_(u"Add"), addModus=True, **kwds):
         """Constructor for Publisher controller 
 
         :param parent: caller
         """
         self.view = wx.Dialog(parent, wx.ID_ANY,
               style=wx.DEFAULT_DIALOG_STYLE,
-              title="%s Record" % title)
+              title=_(u"%s - Record") % title)
         self.view.SetName("dlgPublisher")
         super(Publisher, self).__init__(parent, view=self.view,
                                         model="Publisher",
-                                        row=None, title="Add",
-                                        addModus=True, **kwds)
+                                        row=row, title=title,
+                                        addModus=addModus, **kwds)
 
-        self.baseTitle = "Publisher"
+        self.baseTitle = _(u"Publisher")
         self.modusTitle = title
         
         self._AddModus = addModus
         self.dbItem = row
 
         # create some widgets
-        lbl = wx.StaticText(self.view, label="%s Record" % title)
+        lbl = wx.StaticText(self.view, label=_(u"%s - Record") % title)
         lbl.SetFont(wx.Font(dlgFontHeader, dlgFontFam, wx.NORMAL, wx.BOLD))
         self.dlgSizer.Add(lbl, 0, wx.CENTER)
 
         stFont = wx.Font(dlgFontSt, dlgFontFam, wx.NORMAL, wx.BOLD)
 
-        nameLbl = wx.StaticText(self.view, label="Name:")
+        nameLbl = wx.StaticText(self.view, label=_(u"Name:"))
         nameLbl.SetFont(stFont)
         self.nameTxt = tcs.TextCtrl(self.view)
         self.nameTxt.dbParent = self

File mlsrc/controllers/d_publishers.py

 
         self.view = wx.Dialog(parent, wx.ID_ANY,
               style=wx.DEFAULT_DIALOG_STYLE,
-              title="Maintain publisher information")
+              title=_(u"Maintain publisher information"))
         self.view.SetName("dPublishers")
         super(Publishers, self).__init__(view=self.view, model="Publisher",
                                          **kwds)
 
-        scats = ["Publisher", ]
+        scats = [(_(u"Publisher"), "Publisher"), ]
         self.initDlgListBase(scats)
 
     #----------------------------------------------------------------------
         """
         selectedRow = self.theOlv.getList().GetSelectedObject()
         if selectedRow == None:
-            commonDlgs.showMessageDlg("No row selected!", "Error")
+            commonDlgs.showMessageDlg(_(u"No row selected!"), _(u"Error"))
             return
-        dlg = dPublisher.Publisher(self.view, selectedRow, title="Modify",
+        dlg = dPublisher.Publisher(self.view, selectedRow, title=_(u"Modify"),
                                                  addModus=False).view
         dlg.ShowModal()
         dlg.Destroy()

File mlsrc/controllers/p_books.py

         super(Books, self).__init__(view=self.view, model="Book",
                                          **kwds)
 
-        scats = ["Author", "Title", "ISBN", "Publisher"]
+        scats = [(_(u"Author"), "Author"),
+                 (_("Title"), "Title"),
+                 (_("ISBN"), "ISBN"),
+                 (_("Publisher"), "Publisher"),
+                 ]
         self.initDlgListBase(scats)
 
     #----------------------------------------------------------------------
         """
         selectedRow = self.theOlv.getList().GetSelectedObject()
         if selectedRow == None:
-            commonDlgs.showMessageDlg("No row selected!", "Error")
+            commonDlgs.showMessageDlg(_(u"No row selected!"), _(u"Error"))
             return
-        dlg = dBook.Book(self.view, selectedRow, title="Modify",
+        dlg = dBook.Book(self.view, selectedRow, title=_(u"Modify"),
                                                  addModus=False).view
         dlg.ShowModal()
         dlg.Destroy()

File mlsrc/libui/mixins.py

 #!/usr/bin/env python
 """Mixin's for different ui controls, e.g. textctrl, checkbox etc"""
 
-class DbMixin:
+class DbMixin(object):
 
     def __init__(self, **kwds):
         """Mixin to initialize db related variables, this just ensures that
         self.dbItemName = ''
 
 
-class LabelMixin:
+class LabelMixin(object):
 
     def __init__(self, **kwds):
         """Mixin to provide a MyLabel property"""

File mlsrc/libui/olvbase.py

 import mlsrc.models as db
 from mlsrc.models.sautils import no_autoflush as no_autoflush
 
-# needs to be changed to fully support i18n
-_ = wx.GetTranslation
-
 class OlvBase(object):
     def __init__(self, *args, **kwds):
         """Constructor"""
 
         self.ignoreDataDirty = False
 
-        self.EmptyListMsg = _('Nothing found for the entered search criteria')
+        self.EmptyListMsg = _(u"Nothing found for the entered search criteria")
 
         # minimal reports
-        self.listMinMenuDesc = _('Preview - List - minimal')
-        self.listNormMenuDesc = _('Preview - List - normal')
-        self.listMinReportDesc = _('List minimal')
-        self.listNormReportDesc = _('List normal')
+        self.listMinMenuDesc = _(u"Preview - List - minimal")
+        self.listNormMenuDesc = _(u"Preview - List - normal")
+        self.listMinReportDesc = _(u"List minimal")
+        self.listNormReportDesc = _(u"List normal")
 
-        self.singleItemText = _("%(title)s [only %(count)d item]")
-        self.pluralItemsText = _("%(title)s [%(count)d items]")
+        self.singleItemText = _(u"%(title)s [only %(count)d item]")
+        self.pluralItemsText = _(u"%(title)s [%(count)d items]")
 
     def getRel(self, data, relation):
         """Resolve dotted relation entry
         item = wx.MenuItem(menu, self.previewListNormID, self.listNormMenuDesc)
         menu.AppendItem(item)
         item = wx.MenuItem(menu, self.saveColumConfigID,
-                           _("Save the current column settings."))
+                           _(u"Save the current column settings."))
         menu.AppendItem(item)
 
         # Popup the menu.  If an item is selected then its handler
         # adapt the format
         printer.ReportFormat.IncludeImages = True
 
-        printer.SetPageHeader(self.listMinReportDesc, '', wx.GetApp().GetPrefs().owner.strip())
-        printer.SetPageFooter("%(date)s", '', "%(currentPage)d of %(totalPages)d")
+        printer.SetPageHeader(self.listMinReportDesc, '', 
+                              wx.GetApp().GetPrefs().owner.strip())
+        printer.SetPageFooter(u"%(date)s", '',
+                              _(u"%(currentPage)d of %(totalPages)d"))
 
         # set printData
         printer.GetPrintData().SetOrientation(wx.LANDSCAPE)
         printer.ReportFormat.IncludeImages = True
 
         printer.SetPageHeader(self.listNormReportDesc, '', wx.GetApp().GetPrefs().owner.strip())
-        printer.SetPageFooter("%(date)s", '', "%(currentPage)d of %(totalPages)d")
+        printer.SetPageFooter(u"%(date)s", '',
+                              _(u"%(currentPage)d of %(totalPages)d"))
 
         # set printData
         printer.GetPrintData().SetOrientation(wx.LANDSCAPE)

File mlsrc/libui/olvgroup.py

 import wx
 import wx.lib.art.flagart as flags
 
-# needs to be changed to fully support i18n
-_ = wx.GetTranslation
-
 import mlsrc.models as db
 from mlsrc.models.sautils import no_autoflush as no_autoflush
 
             [db.Recipeit, (db.Recipe, db.Recipe.recipeid==db.Recipeit.fk_recipeid)]
         """
 
-        self.EmptyListMsg = (_('No %s are found for the entered search criteria') % desc)
-        self.listMinMenuDesc = (_('Preview - %s List - minimal') % desc)
-        self.listNormMenuDesc = (_('Preview - %s List - normal') % desc)
-        self.listMinReportDesc = (_('%s - list') % desc)
-        self.listNormReportDesc = (_('%s - list') % desc)
+        self.EmptyListMsg = (_(u"No %s are found for the entered search criteria") % desc)
+        self.listMinMenuDesc = (_(u"Preview - %s List - minimal") % desc)
+        self.listNormMenuDesc = (_(u"Preview - %s List - normal") % desc)
+        self.listMinReportDesc = (_(u"%s - list") % desc)
+        self.listNormReportDesc = (_(u"%s - list") % desc)
 
         self.tableName = table
         ds = wx.GetApp().session

File mlsrc/libui/uiutils.py

 import wx
 import wx.lib.agw.aui as aui
 
-# needs to be changed to fully support i18n
-_ = wx.GetTranslation
-
 import buttons
 import searchctrl
 import mlsrc.controllers.validators as validators
     :param pane: pane to hold buttons
     :param blist: list of buttons to create
 
-    Following a sample list:
-    
     blist = [['btnname', wx.ID_ANY,
              'btnlabel',
              'btnhelptext',
              'btnevthandler',
              'bitmap],
              ]
-    
+
     """
     bStyle = "bmp"
     for b in blist: