Parcourir la source

wxGUI: avoid gettext warnings
(merge https://trac.osgeo.org/grass/changeset/43891 from devbr6)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@43892 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa il y a 14 ans
Parent
commit
bd5fba2465

+ 9 - 5
gui/wxpython/gui_modules/gcpmanager.py

@@ -1108,11 +1108,15 @@ class GCP(MapFrame, wx.Frame, ColumnSorterMixin):
             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':

+ 3 - 2
gui/wxpython/gui_modules/gcpmapdisp.py

@@ -846,8 +846,9 @@ class MapFrame(wx.Frame):
             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)
             

+ 3 - 2
gui/wxpython/gui_modules/gmodeler.py

@@ -819,8 +819,9 @@ class ModelFrame(wx.Frame):
         
         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"""

+ 3 - 1
gui/wxpython/gui_modules/menuform.py

@@ -2121,7 +2121,9 @@ class GUI:
                     
                     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']
                     

+ 10 - 11
gui/wxpython/gui_modules/preferences.py

@@ -893,14 +893,14 @@ class Settings:
             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"""
@@ -2171,13 +2171,12 @@ class MapsetAccess(wx.Dialog):
         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)