format a few strings with str.format(). fix #3405

This commit is contained in:
ThomasV 2017-12-12 16:55:50 +01:00
parent fdd10bfb60
commit c7a47a06b5
3 changed files with 6 additions and 6 deletions

View File

@ -527,10 +527,10 @@ class InstallWizard(QDialog, MessageBoxMixin, BaseWizard):
grid.addWidget(m_label, 1, 0) grid.addWidget(m_label, 1, 0)
grid.addWidget(m_edit, 1, 1) grid.addWidget(m_edit, 1, 1)
def on_m(m): def on_m(m):
m_label.setText(_('Require %d signatures')%m) m_label.setText(_('Require {0} signatures').format(m))
cw.set_m(m) cw.set_m(m)
def on_n(n): def on_n(n):
n_label.setText(_('From %d cosigners')%n) n_label.setText(_('From {0} cosigners').format(n))
cw.set_n(n) cw.set_n(n)
m_edit.setMaximum(n) m_edit.setMaximum(n)
n_edit.valueChanged.connect(on_n) n_edit.valueChanged.connect(on_n)

View File

@ -355,14 +355,14 @@ class NetworkChoiceLayout(object):
height_str = "%d "%(self.network.get_local_height()) + _('blocks') height_str = "%d "%(self.network.get_local_height()) + _('blocks')
self.height_label.setText(height_str) self.height_label.setText(height_str)
n = len(self.network.get_interfaces()) n = len(self.network.get_interfaces())
status = _("Connected to %d nodes.")%n if n else _("Not connected") status = _("Connected to {0} nodes.").format(n) if n else _("Not connected")
self.status_label.setText(status) self.status_label.setText(status)
chains = self.network.get_blockchains() chains = self.network.get_blockchains()
if len(chains)>1: if len(chains)>1:
chain = self.network.blockchain() chain = self.network.blockchain()
checkpoint = chain.get_checkpoint() checkpoint = chain.get_checkpoint()
name = chain.get_name() name = chain.get_name()
msg = _('Chain split detected at block %d')%checkpoint + '\n' msg = _('Chain split detected at block {0}').format(checkpoint) + '\n'
msg += (_('You are following branch') if auto_connect else _('Your server is on branch'))+ ' ' + name msg += (_('You are following branch') if auto_connect else _('Your server is on branch'))+ ' ' + name
msg += ' (%d %s)' % (chain.get_branch_size(), _('blocks')) msg += ' (%d %s)' % (chain.get_branch_size(), _('blocks'))
else: else:

View File

@ -35,7 +35,7 @@ from .qrtextedit import ShowQRTextEdit, ScanQRTextEdit
def seed_warning_msg(seed): def seed_warning_msg(seed):
return ''.join([ return ''.join([
"<p>", "<p>",
_("Please save these %d words on paper (order is important). "), _("Please save these {0} words on paper (order is important). "),
_("This seed will allow you to recover your wallet in case " _("This seed will allow you to recover your wallet in case "
"of computer failure."), "of computer failure."),
"</p>", "</p>",
@ -45,7 +45,7 @@ def seed_warning_msg(seed):
"<li>" + _("Never type it on a website.") + "</li>", "<li>" + _("Never type it on a website.") + "</li>",
"<li>" + _("Do not store it electronically.") + "</li>", "<li>" + _("Do not store it electronically.") + "</li>",
"</ul>" "</ul>"
]) % len(seed.split()) ]).format(len(seed.split()))
class SeedLayout(QVBoxLayout): class SeedLayout(QVBoxLayout):