Commit 2afaf4c6 authored by Guillaume Seguin's avatar Guillaume Seguin

Use format strings as much as possible for translations

parent 9a20974d
This diff is collapsed.
...@@ -224,7 +224,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -224,7 +224,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if f>=0: if f>=0:
if self.p.online: if self.p.online:
self.p.send_now("M104 S"+l) self.p.send_now("M104 S"+l)
print _("Setting hotend temperature to "),f,_(" degrees Celsius.") print _("Setting hotend temperature to %f degrees Celsius.") % f
self.hsetpoint=f self.hsetpoint=f
self.hottgauge.SetTarget(int(f)) self.hottgauge.SetTarget(int(f))
if f>0: if f>0:
...@@ -260,7 +260,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -260,7 +260,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if f>=0: if f>=0:
if self.p.online: if self.p.online:
self.p.send_now("M140 S"+l) self.p.send_now("M140 S"+l)
print _("Setting bed temperature to "),f,_(" degrees Celsius.") print _("Setting bed temperature to %f degrees Celsius.") % f
self.bsetpoint=f self.bsetpoint=f
self.bedtgauge.SetTarget(int(f)) self.bedtgauge.SetTarget(int(f))
if f>0: if f>0:
...@@ -408,7 +408,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -408,7 +408,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.macros.has_key(macro): if self.macros.has_key(macro):
old_def = self.macros[macro] old_def = self.macros[macro]
elif hasattr(self.__class__,"do_"+macro): elif hasattr(self.__class__,"do_"+macro):
print _("Name '")+macro+_("' is being used by built-in command") print _("Name '%s' is being used by built-in command") % macro
return return
elif len([c for c in macro if not c.isalnum() and c != "_"]): elif len([c for c in macro if not c.isalnum() and c != "_"]):
print _("Macro name may contain only alphanumeric symbols and underscores") print _("Macro name may contain only alphanumeric symbols and underscores")
...@@ -1170,14 +1170,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1170,14 +1170,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.p.printing: if self.p.printing:
fractioncomplete = float(self.p.queueindex)/len(self.p.mainqueue) fractioncomplete = float(self.p.queueindex)/len(self.p.mainqueue)
string+= _(" Printing:%04.2f %% |") % (100*float(self.p.queueindex)/len(self.p.mainqueue),) string+= _(" Printing:%04.2f %% |") % (100*float(self.p.queueindex)/len(self.p.mainqueue),)
string+= _(" Line# ") + str(self.p.queueindex) + _("of ") + str(len(self.p.mainqueue)) + _(" lines |" ) string+= _(" Line# %d of %d lines |" ) % (self.p.queueindex, len(self.p.mainqueue))
if fractioncomplete > 0.0: if fractioncomplete > 0.0:
secondselapsed = int(time.time()-self.starttime) secondselapsed = int(time.time()-self.starttime)
secondsestimate = secondselapsed/fractioncomplete secondsestimate = secondselapsed/fractioncomplete
secondsremain = secondsestimate - secondselapsed secondsremain = secondsestimate - secondselapsed
string+= _(" Est: ") + time.strftime('%H:%M:%S', time.gmtime(secondsremain)) string+= _(" Est: %s of %s remaining | ") % (time.strftime('%H:%M:%S', time.gmtime(secondsremain)),
string+= _(" of: ") + time.strftime('%H:%M:%S', time.gmtime(secondsestimate)) time.strftime('%H:%M:%S', time.gmtime(secondsestimate)))
string+= _(" Remaining | ")
string+= _(" Z: %0.2f mm") % self.curlayer string+= _(" Z: %0.2f mm") % self.curlayer
wx.CallAfter(self.status.SetStatusText,string) wx.CallAfter(self.status.SetStatusText,string)
wx.CallAfter(self.gviz.Refresh) wx.CallAfter(self.gviz.Refresh)
...@@ -1384,7 +1383,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1384,7 +1383,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
of=open(self.filename) of=open(self.filename)
self.f=[i.replace("\n","").replace("\r","") for i in of] self.f=[i.replace("\n","").replace("\r","") for i in of]
of.close of.close
self.status.SetStatusText(_("Loaded ") + name + _(", %d lines") % (len(self.f),)) self.status.SetStatusText(_("Loaded %s, %d lines") % (name, len(self.f)))
wx.CallAfter(self.printbtn.SetLabel, _("Print")) wx.CallAfter(self.printbtn.SetLabel, _("Print"))
wx.CallAfter(self.pausebtn.SetLabel, _("Pause")) wx.CallAfter(self.pausebtn.SetLabel, _("Pause"))
wx.CallAfter(self.pausebtn.Disable) wx.CallAfter(self.pausebtn.Disable)
...@@ -1395,9 +1394,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole): ...@@ -1395,9 +1394,9 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def loadviz(self): def loadviz(self):
Xtot,Ytot,Ztot,Xmin,Xmax,Ymin,Ymax,Zmin,Zmax = pronsole.measurements(self.f) Xtot,Ytot,Ztot,Xmin,Xmax,Ymin,Ymax,Zmin,Zmax = pronsole.measurements(self.f)
print pronsole.totalelength(self.f), _("mm of filament used in this print\n") print pronsole.totalelength(self.f), _("mm of filament used in this print\n")
print _("the print goes from"),Xmin,_("mm to"),Xmax,_("mm in X\nand is"),Xtot,_("mm wide\n") print _("the print goes from %f mm to %f mm in X\nand is %f mm wide\n") % (Xmin, Xmax, Xtot)
print _("the print goes from"),Ymin,_("mm to"),Ymax,_("mm in Y\nand is"),Ytot,_("mm wide\n") print _("the print goes from %f mm to %f mm in Y\nand is %f mm wide\n") % (Ymin, Ymax, Ytot)
print _("the print goes from"),Zmin,_("mm to"),Zmax,_("mm in Z\nand is"),Ztot,_("mm high\n") print _("the print goes from %f mm to %f mm in Z\nand is %f mm high\n") % (Zmin, Zmax, Ztot)
print _("Estimated duration (pessimistic): "), pronsole.estimate_duration(self.f) print _("Estimated duration (pessimistic): "), pronsole.estimate_duration(self.f)
#import time #import time
#t0=time.time() #t0=time.time()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment