[GRASS-SVN] r43891 - grass/branches/develbranch_6/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Oct 13 14:55:11 EDT 2010


Author: martinl
Date: 2010-10-13 11:55:11 -0700 (Wed, 13 Oct 2010)
New Revision: 43891

Modified:
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gcpmanager.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gcpmapdisp.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
   grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
Log:
wxGUI: avoid gettext warnings


Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gcpmanager.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gcpmanager.py	2010-10-13 18:44:19 UTC (rev 43890)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gcpmanager.py	2010-10-13 18:55:11 UTC (rev 43891)
@@ -1108,11 +1108,15 @@
             else:
                 currloc = _("target")
             ret = wx.MessageBox(parent=self,
-                          caption=_("Set GCP coordinates"),
-                          message=_('Set %s coordinates for GCP No. %s? \n\n'
-                                    'East: %s \n'
-                                    'North: %s') % (currloc, str(key), str(coord0), str(coord1)),
-                          style=wx.ICON_QUESTION | wx.YES_NO | wx.CENTRE)
+                                caption=_("Set GCP coordinates"),
+                                message=_('Set %(coor)s coordinates for GCP No. %(key)s? \n\n'
+                                          'East: %(coor0)s \n'
+                                          'North: %(coor1)s') % \
+                                    { 'coor' : currloc,
+                                      'key' : str(key),
+                                      'coor0' : str(coord0),
+                                      'coor1' : str(coord1) },
+                                style=wx.ICON_QUESTION | wx.YES_NO | wx.CENTRE)
 
             # for wingrass
             if os.name == 'nt':

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gcpmapdisp.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gcpmapdisp.py	2010-10-13 18:44:19 UTC (rev 43890)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gcpmapdisp.py	2010-10-13 18:55:11 UTC (rev 43891)
@@ -846,8 +846,9 @@
             self.StatusbarEnableLongHelp(False)
         
         elif self.statusbarWin['toggle'].GetSelection() == 8: # RMS error
-            self.statusbar.SetStatusText(_("Forward: %s, Backward: %s") %
-                                         (self.fwd_rmserror, self.bkw_rmserror))
+            self.statusbar.SetStatusText(_("Forward: %(forw)s, Backward: %(back)s") %
+                                         { 'forw' : self.fwd_rmserror,
+                                           'back' : self.bkw_rmserror })
             # disable long help
             # self.StatusbarEnableLongHelp(False)
             

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-10-13 18:44:19 UTC (rev 43890)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/gmodeler.py	2010-10-13 18:55:11 UTC (rev 43891)
@@ -819,8 +819,9 @@
         
         self.modelFile = filename
         self.SetTitle(self.baseTitle + " - " +  os.path.basename(self.modelFile))
-        self.SetStatusText(_('%d items (%d actions) loaded into model') % \
-                               (self.model.GetNumItems(), self.model.GetNumItems(actionOnly = True)), 0)
+        self.SetStatusText(_('%(items)d items (%(actions)d actions) loaded into model') % \
+                               { 'items' : self.model.GetNumItems(),
+                                 'actions' : self.model.GetNumItems(actionOnly = True) }, 0)
         
     def OnModelSave(self, event = None):
         """!Save model to file"""

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-10-13 18:44:19 UTC (rev 43890)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/menuform.py	2010-10-13 18:55:11 UTC (rev 43891)
@@ -1954,7 +1954,9 @@
                     
                     element = self.grass_task.get_param(key, raiseError = False)
                     if not element:
-                        err.append(_("%s: parameter '%s' not available") % (cmd[0], key))
+                        err.append(_("%(cmd)s: parameter '%(key)s' not available") % \
+                                       { 'cmd' : cmd[0],
+                                         'key' : key })
                         continue
                     element = element['element']
                     

Modified: grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2010-10-13 18:44:19 UTC (rev 43890)
+++ grass/branches/develbranch_6/gui/wxpython/gui_modules/preferences.py	2010-10-13 18:55:11 UTC (rev 43891)
@@ -910,14 +910,14 @@
             try:
                 dict[group][key][subkey[0]][subkey[1]] = value
             except TypeError:
-                print >> sys.stderr, _("Unable to parse settings '%s' (%s:%s:%s:%s)") % \
-                    (value, group, key, subkey[0], subkey[1])
+                print >> sys.stderr, _("Unable to parse settings '%s'") % value + \
+                    ' (' + group + ':' + key + ':' + subkey[0] + ':' + subkey[1] + ')'
         else:
             try:
                 dict[group][key][subkey] = value
             except TypeError:
-                print >> sys.stderr, _("Unable to parse settings '%s' (%s:%s:%s)") % \
-                    (value, group, key, subkey)
+                print >> sys.stderr, _("Unable to parse settings '%s'") % value + \
+                    ' (' + group + ':' + key + ':' + subkey + ')'
         
     def GetDefaultSettings(self):
         """!Get default user settings"""
@@ -2221,13 +2221,12 @@
         sizer = wx.BoxSizer(wx.VERTICAL)
 
         label = wx.StaticText(parent=self, id=wx.ID_ANY,
-                              label=_("Check a mapset to make it accessible, uncheck it to hide it.%s"
-                                      "  Notes:%s"
-                                      "    - The current mapset is always accessible.%s"
-                                      "    - You may only write to the current mapset.%s"
-                                      "    - You may only write to mapsets which you own.") %
-                                       (os.linesep, os.linesep, os.linesep, os.linesep))
-
+                              label=_("Check a mapset to make it accessible, uncheck it to hide it.\n"
+                                      "  Notes:\n"
+                                      "    - The current mapset is always accessible.\n"
+                                      "    - You may only write to the current mapset.\n"
+                                      "    - You may only write to mapsets which you own."))
+        
         sizer.Add(item=label, proportion=0,
                   flag=wx.ALL, border=5)
 



More information about the grass-commit mailing list