Browse Source

Add translations and fixes to 1.9 master

Added translations, fixes to syntax errors and other minor fixes for
text strings.

Tested all changes. I hope not to break anyhting…

I was unsurem, but the menu bar on the Lite GUI dissapeared. Looking at
the commits on master, it seems that it wasn't me.
283
rdymac 12 years ago
parent
commit
10be6e7609
  1. 8
      app.fil
  2. 6
      gui/gui_classic/installwizard.py
  3. 4
      gui/gui_classic/lite_window.py
  4. 36
      gui/gui_classic/main_window.py
  5. 28
      gui/gui_classic/transaction_dialog.py
  6. 2
      lib/version.py
  7. 2
      plugins/labels.py

8
app.fil

@ -2,6 +2,14 @@ gui/gui_gtk.py
gui/gui_classic/main_window.py gui/gui_classic/main_window.py
gui/gui_classic/lite_window.py gui/gui_classic/lite_window.py
gui/gui_classic/history_widget.py gui/gui_classic/history_widget.py
gui/gui_classic/installwizard.py
gui/gui_classic/network_dialog.py
gui/gui_classic/password_dialog.py
gui/gui_classic/qt_util.py
gui/gui_classic/receiving_widget.py
gui/gui_classic/seed_dialog.py
gui/gui_classic/transaction_dialog.py
gui/gui_classic/version_getter.py
plugins/aliases.py plugins/aliases.py
plugins/pointofsale.py plugins/pointofsale.py
plugins/labels.py plugins/labels.py

6
gui/gui_classic/installwizard.py

@ -30,7 +30,7 @@ class InstallWizard(QDialog):
grid = QGridLayout() grid = QGridLayout()
grid.setSpacing(5) grid.setSpacing(5)
msg = _("Wallet file not found.")+"\n"+_("Do you want to create a new wallet, or to restore an existing one?") msg = _("Wallet file not found.")+"\n\n"+_("Do you want to create a new wallet, or to restore an existing one?"+"\n")
label = QLabel(msg) label = QLabel(msg)
label.setWordWrap(True) label.setWordWrap(True)
grid.addWidget(label, 0, 0) grid.addWidget(label, 0, 0)
@ -76,7 +76,7 @@ class InstallWizard(QDialog):
return return
if r != wallet.seed: if r != wallet.seed:
QMessageBox.warning(None, _('Error'), 'incorrect seed', 'OK') QMessageBox.warning(None, _('Error'), _('Incorrect seed'), _('OK'))
return False return False
else: else:
return True return True
@ -89,7 +89,7 @@ class InstallWizard(QDialog):
vbox = QVBoxLayout(self) vbox = QVBoxLayout(self)
if is_restore: if is_restore:
msg = _("Please enter your wallet seed." + ' ') msg = _("Please enter your wallet seed." + ' ')
msg += _("Your seed can be entered as a sequence of words, or as a hexadecimal string."+ '\n') msg += _("Your seed can be entered as a sequence of words, or as a hexadecimal string."+ ' \n')
else: else:
msg = _("Your seed is important!") \ msg = _("Your seed is important!") \
+ "\n" + _("To make sure that you have properly saved your seed, please retype it here." + ' ') + "\n" + _("To make sure that you have properly saved your seed, please retype it here." + ' ')

4
gui/gui_classic/lite_window.py

@ -131,7 +131,7 @@ def csv_transaction(wallet):
QMessageBox.information(None,"CSV Export created", "Your CSV export has been successfully created.") QMessageBox.information(None,"CSV Export created", "Your CSV export has been successfully created.")
except (IOError, os.error), reason: except (IOError, os.error), reason:
export_error_label = _("Electrum was unable to produce a transaction export.") export_error_label = _("Electrum was unable to produce a transaction 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))
@ -710,7 +710,7 @@ class MiniActuator:
w = QDialog() w = QDialog()
w.resize(200, 70) w.resize(200, 70)
w.setWindowTitle('Electrum') w.setWindowTitle('Electrum')
l = QLabel('Sending transaction, please wait.') l = QLabel(_('Sending transaction, please wait.'))
vbox = QVBoxLayout() vbox = QVBoxLayout()
vbox.addWidget(l) vbox.addWidget(l)
w.setLayout(vbox) w.setLayout(vbox)

36
gui/gui_classic/main_window.py

@ -424,8 +424,8 @@ class ElectrumWindow(QMainWindow):
if(v > 0): if(v > 0):
total_amount += v total_amount += v
self.notify("%s new transactions received. Total amount received in the new transactions %s %s" \ self.notify(_("%(txs)s new transactions received. Total amount received in the new transactions %(amount)s %(unit)s") \
% (tx_amount, self.format_amount(total_amount), self.base_unit())) % { 'txs' : tx_amount, 'amount' : self.format_amount(total_amount), 'unit' : self.base_unit()})
self.network.interface.pending_transactions_for_notifications = [] self.network.interface.pending_transactions_for_notifications = []
else: else:
@ -434,7 +434,7 @@ class ElectrumWindow(QMainWindow):
self.network.interface.pending_transactions_for_notifications.remove(tx) self.network.interface.pending_transactions_for_notifications.remove(tx)
is_relevant, is_mine, v, fee = self.wallet.get_tx_value(tx) is_relevant, is_mine, v, fee = self.wallet.get_tx_value(tx)
if(v > 0): 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): def notify(self, message):
self.tray.showMessage("Electrum", message, QSystemTrayIcon.Information, 20000) self.tray.showMessage("Electrum", message, QSystemTrayIcon.Information, 20000)
@ -458,7 +458,7 @@ class ElectrumWindow(QMainWindow):
try: try:
self.plugins.append( p.Plugin(self, name) ) self.plugins.append( p.Plugin(self, name) )
except: except:
print_msg("Error:cannot initialize plugin",p) print_msg(_("Error: cannot initialize plugin"),p)
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)
@ -684,7 +684,7 @@ class ElectrumWindow(QMainWindow):
try: try:
time_str = datetime.datetime.fromtimestamp( timestamp).isoformat(' ')[:-3] time_str = datetime.datetime.fromtimestamp( timestamp).isoformat(' ')[:-3]
except: except:
time_str = "unknown" time_str = _("unknown")
if conf == -1: if conf == -1:
time_str = 'unverified' time_str = 'unverified'
@ -876,7 +876,7 @@ class ElectrumWindow(QMainWindow):
confirm_amount = self.config.get('confirm_amount', 100000000) confirm_amount = self.config.get('confirm_amount', 100000000)
if amount >= confirm_amount: 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 return
self.send_tx(to_address, amount, fee, label) self.send_tx(to_address, amount, fee, label)
@ -951,7 +951,7 @@ class ElectrumWindow(QMainWindow):
self.set_frozen(self.payto_e,True) self.set_frozen(self.payto_e,True)
self.set_frozen(self.amount_e,True) self.set_frozen(self.amount_e,True)
self.set_frozen(self.message_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: else:
self.payto_sig.setVisible(False) self.payto_sig.setVisible(False)
@ -1192,7 +1192,7 @@ class ElectrumWindow(QMainWindow):
for is_change in ([0,1] if self.expert_mode else [0]): for is_change in ([0,1] if self.expert_mode else [0]):
if self.expert_mode: if self.expert_mode:
name = "Receiving" if not is_change else "Change" name = _("Receiving") if not is_change else _("Change")
seq_item = QTreeWidgetItem( [ name, '', '', '', ''] ) seq_item = QTreeWidgetItem( [ name, '', '', '', ''] )
account_item.addChild(seq_item) account_item.addChild(seq_item)
if not is_change: seq_item.setExpanded(True) if not is_change: seq_item.setExpanded(True)
@ -1435,7 +1435,7 @@ class ElectrumWindow(QMainWindow):
def show_qrcode(self, data, title = "QR code"): def show_qrcode(self, data, title = _("QR code")):
if not data: return if not data: return
d = QDialog(self) d = QDialog(self)
d.setModal(1) d.setModal(1)
@ -1490,7 +1490,7 @@ class ElectrumWindow(QMainWindow):
except BaseException, e: except BaseException, e:
self.show_message(str(e)) self.show_message(str(e))
return 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 @protected
@ -1642,7 +1642,7 @@ class ElectrumWindow(QMainWindow):
except: except:
pass 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"))
@ -1654,7 +1654,7 @@ class ElectrumWindow(QMainWindow):
with open(fileName, "r") as f: with open(fileName, "r") as f:
file_content = f.read() file_content = f.read()
except (ValueError, IOError, os.error), reason: 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) return self.tx_from_text(file_content)
@ -1685,7 +1685,7 @@ class ElectrumWindow(QMainWindow):
amount = int(100000000*amount) amount = int(100000000*amount)
outputs.append((address, amount)) outputs.append((address, amount))
except (ValueError, IOError, os.error), reason: 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 return
try: try:
@ -1705,7 +1705,7 @@ class ElectrumWindow(QMainWindow):
csvReader = csv.reader(f) csvReader = csv.reader(f)
self.do_process_from_csvReader(csvReader) self.do_process_from_csvReader(csvReader)
except (ValueError, IOError, os.error), reason: 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 return
def do_process_from_csv_text(self): def do_process_from_csv_text(self):
@ -1740,7 +1740,7 @@ class ElectrumWindow(QMainWindow):
except (IOError, os.error), reason: except (IOError, os.error), reason:
export_error_label = _("Electrum was unable to produce a private key-export.") 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: except BaseException, e:
self.show_message(str(e)) self.show_message(str(e))
@ -1768,9 +1768,9 @@ class ElectrumWindow(QMainWindow):
if fileName: if fileName:
with open(fileName, 'w+') as f: with open(fileName, 'w+') as f:
json.dump(labels, 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: 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): def do_export_history(self):
@ -1939,7 +1939,7 @@ class ElectrumWindow(QMainWindow):
grid_plugins.addWidget(EnterButton(_('Settings'), p.settings_dialog), i, 1) grid_plugins.addWidget(EnterButton(_('Settings'), p.settings_dialog), i, 1)
grid_plugins.addWidget(HelpButton(p.description()), i, 2) grid_plugins.addWidget(HelpButton(p.description()), i, 2)
except: except:
print_msg("Error: cannot display plugin", p) print_msg(_("Error: cannot display plugin"), p)
traceback.print_exc(file=sys.stdout) traceback.print_exc(file=sys.stdout)
grid_plugins.setRowStretch(i+1,1) grid_plugins.setRowStretch(i+1,1)

28
gui/gui_classic/transaction_dialog.py

@ -46,13 +46,13 @@ class TxDialog(QDialog):
QDialog.__init__(self) QDialog.__init__(self)
self.setMinimumWidth(600) self.setMinimumWidth(600)
self.setWindowTitle(_('Transaction')) self.setWindowTitle(_("Transaction"))
self.setModal(1) self.setModal(1)
vbox = QVBoxLayout() vbox = QVBoxLayout()
self.setLayout(vbox) self.setLayout(vbox)
vbox.addWidget(QLabel("Transaction ID:")) vbox.addWidget(QLabel(_("Transaction ID:")))
self.tx_hash_e = QLineEdit() self.tx_hash_e = QLineEdit()
self.tx_hash_e.setReadOnly(True) self.tx_hash_e.setReadOnly(True)
vbox.addWidget(self.tx_hash_e) vbox.addWidget(self.tx_hash_e)
@ -119,7 +119,7 @@ class TxDialog(QDialog):
is_relevant, is_mine, v, fee = self.wallet.get_tx_value(self.tx) is_relevant, is_mine, v, fee = self.wallet.get_tx_value(self.tx)
if self.tx.is_complete: if self.tx.is_complete:
status = "Status: Signed" status = _("Status: Signed")
self.sign_button.hide() self.sign_button.hide()
if tx_hash in self.wallet.transactions.keys(): if tx_hash in self.wallet.transactions.keys():
@ -128,14 +128,14 @@ class TxDialog(QDialog):
time_str = datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:-3] time_str = datetime.datetime.fromtimestamp(timestamp).isoformat(' ')[:-3]
else: else:
time_str = 'pending' time_str = 'pending'
status = "Status: %d confirmations"%conf status = _("Status: %d confirmations")%conf
self.broadcast_button.hide() self.broadcast_button.hide()
else: else:
time_str = None time_str = None
conf = 0 conf = 0
self.broadcast_button.show() self.broadcast_button.show()
else: else:
status = "Status: Unsigned" status = _("Status: Unsigned")
time_str = None time_str = None
self.sign_button.show() self.sign_button.show()
self.broadcast_button.hide() self.broadcast_button.hide()
@ -144,7 +144,7 @@ class TxDialog(QDialog):
self.status_label.setText(status) self.status_label.setText(status)
if time_str is not None: 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() self.date_label.show()
else: else:
self.date_label.hide() self.date_label.hide()
@ -152,15 +152,15 @@ class TxDialog(QDialog):
if is_relevant: if is_relevant:
if is_mine: if is_mine:
if fee is not None: if fee is not None:
self.amount_label.setText("Amount sent: %s"% self.parent.format_amount(v-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()) self.fee_label.setText(_("Transaction fee:")+' %s'% self.parent.format_amount(fee) + ' ' + self.parent.base_unit())
else: else:
self.amount_label.setText("Amount sent: %s"% self.parent.format_amount(v) + ' ' + self.parent.base_unit()) self.amount_label.setText(_("Amount sent:")+' %s'% self.parent.format_amount(v) + ' ' + self.parent.base_unit())
self.fee_label.setText("Transaction fee: unknown") self.fee_label.setText(_("Transaction fee: unknown"))
else: 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: 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 exec_menu(self, position,l):
@ -197,11 +197,11 @@ class TxDialog(QDialog):
def broadcast(self): def broadcast(self):
result, result_message = self.wallet.sendtx( self.tx ) result, result_message = self.wallet.sendtx( self.tx )
if result: if result:
self.show_message("Transaction successfully sent: %s" % (result_message)) self.show_message(_("Transaction successfully sent:")+' %s' % (result_message))
if dialog: if dialog:
dialog.done(0) dialog.done(0)
else: 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): def show_message(self, msg):
QMessageBox.information(self, _('Message'), msg, _('OK')) QMessageBox.information(self, _('Message'), msg, _('OK'))

2
lib/version.py

@ -1,4 +1,4 @@
ELECTRUM_VERSION = "1.9" # version of the client package ELECTRUM_VERSION = "1.9" # version of the client package
PROTOCOL_VERSION = '0.6' # protocol version requested PROTOCOL_VERSION = '0.6' # protocol version requested
SEED_VERSION = 5 # bump this every time the seed generation is modified SEED_VERSION = 5 # bump this every time the seed generation is modified
TRANSLATION_ID = 4101 # version of the wiki page TRANSLATION_ID = 4118 # version of the wiki page

2
plugins/labels.py

@ -28,7 +28,7 @@ class Plugin(BasePlugin):
return _('Label Sync') return _('Label Sync')
def description(self): def description(self):
return '%s\n\n%s%s%s' % (_("This plugin can sync your labels across multiple Electrum installs by using a remote database to save your data. Labels, transactions and addresses are all sent and stored encrypted on the remote server. This code might increase the load of your wallet with a few microseconds as it will sync labels on each startup."), _("To get started visit"), " http://labelectrum.herokuapp.com/", _(" to sign up for an account.")) return '%s\n\n%s%s%s' % (_("This plugin can sync your labels across multiple Electrum installs by using a remote database to save your data. Labels, transactions and addresses are all sent and stored encrypted on the remote server. This code might increase the load of your wallet with a few microseconds as it will sync labels on each startup."), _("To get started visit"), " http://labelectrum.herokuapp.com/ ", _(" to sign up for an account."))
def version(self): def version(self):
return "0.2.1" return "0.2.1"

Loading…
Cancel
Save