Changeset 50514


Ignore:
Timestamp:
Jan 28, 2012, 2:07:06 AM (13 years ago)
Author:
martinl
Message:

wxGUI: fix gettext warning

Location:
grass/branches/develbranch_6/gui/wxpython
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • grass/branches/develbranch_6/gui/wxpython/gmodeler/model.py

    r50394 r50514  
    386386                                break
    387387                        if report:
    388                             errList.append(_("%s: undefined variable '%s'") % (cmd[0], var))
     388                            errList.append(cmd[0] + ": " + _("undefined variable '%s'") % var)
    389389            ### TODO: check variables in file only optionally
    390390            ### errList += self._substituteFile(action, checkOnly = True)
     
    448448                var = sval.group(2).strip()[1:] # ignore '%'
    449449                cmd = item.GetLog(string = False)[0]
    450                 errList.append(_("%s: undefined variable '%s'") % (cmd, var))
     450                errList.append(cmd + ": " + _("undefined variable '%s'") % var)
    451451           
    452452            if not checkOnly:
  • grass/branches/develbranch_6/gui/wxpython/gui_core/goutput.py

    r50394 r50514  
    760760        if self.parent.GetName() == 'Modeler':
    761761            self.parent.OnCmdDone(event)
     762           
     763        # Process results here
     764        try:
     765            ctime = time.time() - event.time
     766            if ctime < 60:
     767                stime = _("%d sec") % int(ctime)
     768            else:
     769                mtime = int(ctime / 60)
     770                stime = _("%(min)d min %(sec)d sec") %  { 'min' : mtime,
     771                                                          'sec' : int(ctime - (mtime * 60)) }
     772        except KeyError:
     773            # stopped deamon
     774            stime = _("unknown")
    762775       
    763776        if event.aborted:
     
    765778            self.WriteLog(_('Please note that the data are left in inconsistent state '
    766779                            'and may be corrupted'), self.cmdOutput.StyleWarning)
    767             self.WriteCmdLog('(%s) %s (%d sec)' % (str(time.ctime()),
    768                                                    _('Command aborted'),
    769                                                    (time.time() - event.time)))
    770             # pid=self.cmdThread.requestId)
    771             self.btnCmdAbort.Enable(False)
    772         else:
    773             try:
    774                 # Process results here
    775                 ctime = time.time() - event.time
    776                 if ctime < 60:
    777                     stime = _("%d sec") % int(ctime)
    778                 else:
    779                     mtime = int(ctime / 60)
    780                     stime = _("%d min %d sec") % (mtime,
    781                                                   int(ctime - (mtime * 60)))
    782                
    783                 self.WriteCmdLog('(%s) %s (%s)' % (str(time.ctime()),
    784                                                    _('Command finished'),
    785                                                    (stime)))
    786             except KeyError:
    787                 # stopped deamon
    788                 pass
    789 
    790             self.btnCmdAbort.Enable(False)
     780            msg = _('Command aborted')
     781        else:
     782            msg = _('Command finished')
     783           
     784        self.WriteCmdLog('(%s) %s (%s)' % (str(time.ctime()), msg, stime))
     785        self.btnCmdAbort.Enable(False)
    791786       
    792787        if event.onDone:
  • grass/branches/develbranch_6/gui/wxpython/modules/colorrules.py

    r49851 r50514  
    11691169            # currently v.colors need the map to be in current mapset
    11701170            if self.version7 and self.attributeType == 'color':
    1171                 message = _("Selected map <%s> is not in current mapset <%s>. "
     1171                message = _("Selected map <%(map)s> is not in current mapset <%(mapset)s>. "
    11721172                            "Color rules cannot be edited.") % \
    1173                             (self.inmap, grass.gisenv()['MAPSET'])
     1173                            { 'map' : self.inmap,
     1174                              'mapset' : grass.gisenv()['MAPSET'] }
    11741175            else:
    1175                 message = _("Selected map <%s> is not in current mapset <%s>. "
     1176                message = _("Selected map <%(map)s> is not in current mapset <%(mapset)s>. "
    11761177                            "Attribute table cannot be edited.") % \
    1177                             (self.inmap, grass.gisenv()['MAPSET'])
     1178                            { 'map' : self.inmap,
     1179                              'mapset' : grass.gisenv()['MAPSET'] }
    11781180            wx.CallAfter(GMessage, parent = self, message = message)
    11791181            self.DisableClearAll()
     
    14461448        if self.properties['min'] or self.properties['max']:
    14471449            if ctype == float:
    1448                 range = _("(range: %.1f to %.1f)") % (self.properties['min'], self.properties['max'])
     1450                range = "%s: %.1f - %.1f)" % (_("range"),
     1451                                              self.properties['min'], self.properties['max'])
    14491452            elif ctype == int:
    1450                 range = _("(range: %d to %d)") % (self.properties['min'], self.properties['max'])
     1453                range = "%s: %d - %d)" % (_("range"),
     1454                                          self.properties['min'], self.properties['max'])
    14511455        if range:
    14521456            if self.colorTable:
  • grass/branches/develbranch_6/gui/wxpython/psmap/dialogs.py

    r50451 r50514  
    11071107                return False
    11081108        if not os.path.exists(instr['epsfile']):
    1109             GError(_("Failed to read instruction %s: file %s not found.") % instruction, instr['epsfile'])
     1109            GError(_("Failed to read instruction %(inst)s: "
     1110                     "file %(file)s not found.") % { 'inst' : instruction,
     1111                                                     'file' : instr['epsfile'] })
    11101112            return False
    11111113       
     
    60146016    def SetSizeInfoLabel(self, image):
    60156017        """!Update image size label"""
    6016         self.imagePanel.image['sizeInfo'].SetLabel(_("size: %s x %s pts") % (image.GetWidth(), image.GetHeight()))
     6018        self.imagePanel.image['sizeInfo'].SetLabel(_("size: %(width)s x %(height)s pts") % \
     6019                                                       { 'width'  : image.GetWidth(),
     6020                                                         'height' : image.GetHeight() })
    60176021        self.imagePanel.image['sizeInfo'].GetContainingSizer().Layout()
    60186022       
  • grass/branches/develbranch_6/gui/wxpython/wxplot/base.py

    r50322 r50514  
    397397
    398398    def OnMouseLeftDown(self,event):
    399         self.SetStatusText(_("Left Mouse Down at Point: (%.4f, %.4f)") % \
    400                                self.client._getXY(event))
     399        self.SetStatusText(_("Left Mouse Down at Point:") + \
     400                               " (%.4f, %.4f)" % self.client._getXY(event))
    401401        event.Skip() # allows plotCanvas OnMouseLeftDown to be called
    402402
Note: See TracChangeset for help on using the changeset viewer.