if(v > 0):
total_amount += v
- self.notify("%s new transactions received. Total amount received in the new transactions %s %s" \
- % (tx_amount, self.format_amount(total_amount), self.base_unit()))
+ self.notify(_("%(txs)s new transactions received. Total amount received in the new transactions %(amount)s %(unit)s") \
+ % { 'txs' : tx_amount, 'amount' : self.format_amount(total_amount), 'unit' : self.base_unit()})
self.network.interface.pending_transactions_for_notifications = []
else:
self.network.interface.pending_transactions_for_notifications.remove(tx)
is_relevant, is_mine, v, fee = self.wallet.get_tx_value(tx)
if(v > 0):
- self.notify("New transaction received. %s %s" % (self.format_amount(v), self.base_unit()))
+ self.notify(_("New transaction received. %(amount)s %(unit)s") % { 'amount' : self.format_amount(v), 'unit' : self.base_unit()})
def notify(self, message):
self.tray.showMessage("Electrum", message, QSystemTrayIcon.Information, 20000)
try:
self.plugins.append( p.Plugin(self, name) )
except:
- print_msg("Error:cannot initialize plugin",p)
+ print_msg(_("Error: cannot initialize plugin"),p)
traceback.print_exc(file=sys.stdout)
try:
time_str = datetime.datetime.fromtimestamp( timestamp).isoformat(' ')[:-3]
except:
- time_str = "unknown"
+ time_str = _("unknown")
if conf == -1:
time_str = 'unverified'
confirm_amount = self.config.get('confirm_amount', 100000000)
if amount >= confirm_amount:
- if not self.question("send %s to %s?"%(self.format_amount(amount) + ' '+ self.base_unit(), to_address)):
+ if not self.question(_("send %(amount)s to %(address)s?")%{ 'amount' : self.format_amount(amount) + ' '+ self.base_unit(), 'address' : to_address}):
return
self.send_tx(to_address, amount, fee, label)
self.set_frozen(self.payto_e,True)
self.set_frozen(self.amount_e,True)
self.set_frozen(self.message_e,True)
- self.payto_sig.setText( ' The bitcoin URI was signed by ' + identity )
+ self.payto_sig.setText( ' '+_('The bitcoin URI was signed by')+' ' + identity )
else:
self.payto_sig.setVisible(False)
for is_change in ([0,1] if self.expert_mode else [0]):
if self.expert_mode:
- name = "Receiving" if not is_change else "Change"
+ name = _("Receiving") if not is_change else _("Change")
seq_item = QTreeWidgetItem( [ name, '', '', '', ''] )
account_item.addChild(seq_item)
if not is_change: seq_item.setExpanded(True)
- def show_qrcode(self, data, title = "QR code"):
+ def show_qrcode(self, data, title = _("QR code")):
if not data: return
d = QDialog(self)
d.setModal(1)
except BaseException, e:
self.show_message(str(e))
return
- QMessageBox.information(self, _('Private key'), 'Address'+ ': ' + address + '\n\n' + _('Private key') + ': ' + '\n'.join(pk_list), _('OK'))
+ QMessageBox.information(self, _('Private key'), _('Address')+ ': ' + address + '\n\n' + _('Private key') + ': ' + '\n'.join(pk_list), _('OK'))
@protected
except:
pass
- QMessageBox.critical(None, "Unable to parse transaction", _("Electrum was unable to parse your transaction"))
+ QMessageBox.critical(None, _("Unable to parse transaction"), _("Electrum was unable to parse your transaction"))
with open(fileName, "r") as f:
file_content = f.read()
except (ValueError, IOError, os.error), reason:
- QMessageBox.critical(None,"Unable to read file or no transaction found", _("Electrum was unable to open your transaction file") + "\n" + str(reason))
+ QMessageBox.critical(None, _("Unable to read file or no transaction found"), _("Electrum was unable to open your transaction file") + "\n" + str(reason))
return self.tx_from_text(file_content)
amount = int(100000000*amount)
outputs.append((address, amount))
except (ValueError, IOError, os.error), reason:
- QMessageBox.critical(None,"Unable to read file or no transaction found", _("Electrum was unable to open your transaction file") + "\n" + str(reason))
+ QMessageBox.critical(None, _("Unable to read file or no transaction found"), _("Electrum was unable to open your transaction file") + "\n" + str(reason))
return
try:
csvReader = csv.reader(f)
self.do_process_from_csvReader(csvReader)
except (ValueError, IOError, os.error), reason:
- QMessageBox.critical(None,"Unable to read file or no transaction found", _("Electrum was unable to open your transaction file") + "\n" + str(reason))
+ QMessageBox.critical(None, _("Unable to read file or no transaction found"), _("Electrum was unable to open your transaction file") + "\n" + str(reason))
return
def do_process_from_csv_text(self):
except (IOError, os.error), reason:
export_error_label = _("Electrum was unable to produce a private key-export.")
- QMessageBox.critical(None,"Unable to create csv", export_error_label + "\n" + str(reason))
+ QMessageBox.critical(None, _("Unable to create csv"), export_error_label + "\n" + str(reason))
except BaseException, e:
self.show_message(str(e))
if fileName:
with open(fileName, 'w+') as f:
json.dump(labels, f)
- QMessageBox.information(None, "Labels exported", _("Your labels where exported to")+" '%s'" % str(fileName))
+ QMessageBox.information(None, _("Labels exported"), _("Your labels where exported to")+" '%s'" % str(fileName))
except (IOError, os.error), reason:
- QMessageBox.critical(None, "Unable to export labels", _("Electrum was unable to export your labels.")+"\n" + str(reason))
+ QMessageBox.critical(None, _("Unable to export labels"), _("Electrum was unable to export your labels.")+"\n" + str(reason))
def do_export_history(self):
grid_plugins.addWidget(EnterButton(_('Settings'), p.settings_dialog), i, 1)
grid_plugins.addWidget(HelpButton(p.description()), i, 2)
except:
- print_msg("Error: cannot display plugin", p)
+ print_msg(_("Error: cannot display plugin"), p)
traceback.print_exc(file=sys.stdout)
grid_plugins.setRowStretch(i+1,1)
QDialog.__init__(self)
self.setMinimumWidth(600)
- self.setWindowTitle(_('Transaction'))
+ self.setWindowTitle(_("Transaction"))
self.setModal(1)
vbox = QVBoxLayout()
self.setLayout(vbox)
- vbox.addWidget(QLabel("Transaction ID:"))
+ vbox.addWidget(QLabel(_("Transaction ID:")))
self.tx_hash_e = QLineEdit()
self.tx_hash_e.setReadOnly(True)
vbox.addWidget(self.tx_hash_e)
is_relevant, is_mine, v, fee = self.wallet.get_tx_value(self.tx)
if self.tx.is_complete:
- status = "Status: Signed"
+ status = _("Status: Signed")
self.sign_button.hide()
if tx_hash in self.wallet.transactions.keys():
time_str = datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:-3]
else:
time_str = 'pending'
- status = "Status: %d confirmations"%conf
+ status = _("Status: %d confirmations")%conf
self.broadcast_button.hide()
else:
time_str = None
conf = 0
self.broadcast_button.show()
else:
- status = "Status: Unsigned"
+ status = _("Status: Unsigned")
time_str = None
self.sign_button.show()
self.broadcast_button.hide()
self.status_label.setText(status)
if time_str is not None:
- self.date_label.setText("Date: %s"%time_str)
+ self.date_label.setText(_("Date: %s")%time_str)
self.date_label.show()
else:
self.date_label.hide()
if is_relevant:
if is_mine:
if fee is not None:
- self.amount_label.setText("Amount sent: %s"% self.parent.format_amount(v-fee) + ' ' + self.parent.base_unit())
- self.fee_label.setText("Transaction fee: %s"% self.parent.format_amount(fee) + ' ' + self.parent.base_unit())
+ self.amount_label.setText(_("Amount sent:")+' %s'% self.parent.format_amount(v-fee) + ' ' + self.parent.base_unit())
+ self.fee_label.setText(_("Transaction fee:")+' %s'% self.parent.format_amount(fee) + ' ' + self.parent.base_unit())
else:
- self.amount_label.setText("Amount sent: %s"% self.parent.format_amount(v) + ' ' + self.parent.base_unit())
- self.fee_label.setText("Transaction fee: unknown")
+ self.amount_label.setText(_("Amount sent:")+' %s'% self.parent.format_amount(v) + ' ' + self.parent.base_unit())
+ self.fee_label.setText(_("Transaction fee: unknown"))
else:
- self.amount_label.setText("Amount received: %s"% self.parent.format_amount(v) + ' ' + self.parent.base_unit())
+ self.amount_label.setText(_("Amount received:")+' %s'% self.parent.format_amount(v) + ' ' + self.parent.base_unit())
else:
- self.amount_label.setText("Transaction unrelated to your wallet")
+ self.amount_label.setText(_("Transaction unrelated to your wallet"))
def exec_menu(self, position,l):
def broadcast(self):
result, result_message = self.wallet.sendtx( self.tx )
if result:
- self.show_message("Transaction successfully sent: %s" % (result_message))
+ self.show_message(_("Transaction successfully sent:")+' %s' % (result_message))
if dialog:
dialog.done(0)
else:
- self.show_message("There was a problem sending your transaction:\n %s" % (result_message))
+ self.show_message(_("There was a problem sending your transaction:") + '\n %s' % (result_message))
def show_message(self, msg):
QMessageBox.information(self, _('Message'), msg, _('OK'))