Tried to reduce duplicates of translation strings.

This commit is contained in:
Dmitri Bogomolov 2017-03-17 15:41:57 +02:00
parent fe2431ed02
commit 1baa9cdcbf
Signed by untrusted user: g1itch
GPG Key ID: 720A756F18DEED13
3 changed files with 94 additions and 40 deletions

View File

@ -1460,19 +1460,50 @@ class MyForm(settingsmixin.SMainWindow):
# may manage your keys by editing the keys.dat file stored in # may manage your keys by editing the keys.dat file stored in
# the same directory as this program. It is important that you # the same directory as this program. It is important that you
# back up this file.', QMessageBox.Ok) # back up this file.', QMessageBox.Ok)
reply = QtGui.QMessageBox.information(self, 'keys.dat?', _translate( reply = QtGui.QMessageBox.information(
"MainWindow", "You may manage your keys by editing the keys.dat file stored in the same directory as this program. It is important that you back up this file."), QtGui.QMessageBox.Ok) self, 'keys.dat?', _translate(
"MainWindow",
"You may manage your keys by editing the keys.dat"
" file stored in the same directory as this program."
" It is important that you back up this file."),
QtGui.QMessageBox.Ok)
else: else:
QtGui.QMessageBox.information(self, 'keys.dat?', _translate( QtGui.QMessageBox.information(
"MainWindow", "You may manage your keys by editing the keys.dat file stored in\n %1 \nIt is important that you back up this file.").arg(state.appdata), QtGui.QMessageBox.Ok) self, 'keys.dat?', _translate(
"MainWindow",
"You may manage your keys by editing the keys.dat"
" file stored in\n %1 \n"
"It is important that you back up this file."
).arg(state.appdata), QtGui.QMessageBox.Ok)
elif sys.platform == 'win32' or sys.platform == 'win64': elif sys.platform == 'win32' or sys.platform == 'win64':
_tr_open = _translate(
"MainWindow",
" Would you like to open the file now?"
" (Be sure to close Bitmessage before making"
" any changes.)",
"The second part of string begining with "
"\'You may manage your keys ...\' "
"Notice the leading space!"
)
if state.appdata == '': if state.appdata == '':
reply = QtGui.QMessageBox.question(self, _translate("MainWindow", "Open keys.dat?"), _translate( reply = QtGui.QMessageBox.question(
"MainWindow", "You may manage your keys by editing the keys.dat file stored in the same directory as this program. It is important that you back up this file. Would you like to open the file now? (Be sure to close Bitmessage before making any changes.)"), QtGui.QMessageBox.Yes, QtGui.QMessageBox.No) self, _translate("MainWindow", "Open keys.dat?"),
_translate(
"MainWindow",
"You may manage your keys by editing the keys.dat"
" file stored in the same directory as this program."
" It is important that you back up this file."
) + _tr_open, QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
else: else:
reply = QtGui.QMessageBox.question(self, _translate("MainWindow", "Open keys.dat?"), _translate( reply = QtGui.QMessageBox.question(
"MainWindow", "You may manage your keys by editing the keys.dat file stored in\n %1 \nIt is important that you back up this file. Would you like to open the file now? (Be sure to close Bitmessage before making any changes.)").arg(state.appdata), QtGui.QMessageBox.Yes, QtGui.QMessageBox.No) self, _translate("MainWindow", "Open keys.dat?"),
_translate(
"MainWindow",
"You may manage your keys by editing the keys.dat"
" file stored in\n %1 \n"
"It is important that you back up this file."
).arg(state.appdata) + _tr_open,
QtGui.QMessageBox.Yes, QtGui.QMessageBox.No)
if reply == QtGui.QMessageBox.Yes: if reply == QtGui.QMessageBox.Yes:
shared.openKeysFile() shared.openKeysFile()
@ -1960,24 +1991,32 @@ class MyForm(settingsmixin.SMainWindow):
pass pass
logger.error('Error: Could not decode recipient address ' + toAddress + ':' + status) logger.error('Error: Could not decode recipient address ' + toAddress + ':' + status)
_tr_wrong_soft = _translate(
"MainWindow",
"There might be something wrong with the software"
" of your acquaintance.",
"The second part of string begining with "
"\'Error: Some data encoded in the "
"recipient address...\'"
)
if status == 'missingbm': if status == 'missingbm':
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
"Error: Bitmessage addresses start with" "Error: Bitmessage addresses start with"
" BM- Please check the recipient address %1" " BM- Please check the recipient address %1"
).arg(toAddress)) ).arg(toAddress))
elif status == 'checksumfailed': elif status == 'checksumfailed':
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
"Error: The recipient address %1 is not" "Error: The recipient address %1 is not"
" typed or copied correctly. Please check it." " typed or copied correctly. Please check it."
).arg(toAddress)) ).arg(toAddress))
elif status == 'invalidcharacters': elif status == 'invalidcharacters':
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
"Error: The recipient address %1 contains" "Error: The recipient address %1 contains"
" invalid characters. Please check it." " invalid characters. Please check it."
).arg(toAddress)) ).arg(toAddress))
elif status == 'versiontoohigh': elif status == 'versiontoohigh':
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
@ -1985,44 +2024,37 @@ class MyForm(settingsmixin.SMainWindow):
" %1 is too high. Either you need to upgrade" " %1 is too high. Either you need to upgrade"
" your Bitmessage software or your" " your Bitmessage software or your"
" acquaintance is being clever." " acquaintance is being clever."
).arg(toAddress)) ).arg(toAddress))
elif status == 'ripetooshort': elif status == 'ripetooshort':
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
"Error: Some data encoded in the recipient" "Error: Some data encoded in the recipient"
" address %1 is too short. There might be" " address %1 is too short. ").arg(toAddress) +
" something wrong with the software of" _tr_wrong_soft)
" your acquaintance."
).arg(toAddress))
elif status == 'ripetoolong': elif status == 'ripetoolong':
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
"Error: Some data encoded in the recipient" "Error: Some data encoded in the recipient"
" address %1 is too long. There might be" " address %1 is too long. ").arg(toAddress) +
" something wrong with the software of" _tr_wrong_soft)
" your acquaintance."
).arg(toAddress))
elif status == 'varintmalformed': elif status == 'varintmalformed':
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
"Error: Some data encoded in the recipient" "Error: Some data encoded in the recipient"
" address %1 is malformed. There might be" " address %1 is malformed. ").arg(toAddress) +
" something wrong with the software of" _tr_wrong_soft)
" your acquaintance."
).arg(toAddress))
else: else:
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
"Error: Something is wrong with the" "Error: Something is wrong with the"
" recipient address %1." " recipient address %1."
).arg(toAddress)) ).arg(toAddress))
elif fromAddress == '': elif fromAddress == '':
self.updateStatusBar(_translate( self.updateStatusBar(_translate(
"MainWindow", "MainWindow",
"Error: You must specify a From address. If you" "Error: You must specify a From address. If you"
" don\'t have one, go to the" " don\'t have one, go to the"
" \'Your Identities\' tab.") " \'Your Identities\' tab."))
)
else: else:
toAddress = addBMIfNotPresent(toAddress) toAddress = addBMIfNotPresent(toAddress)
@ -2743,10 +2775,27 @@ class MyForm(settingsmixin.SMainWindow):
elif reply == QtGui.QMessageBox.Cancel: elif reply == QtGui.QMessageBox.Cancel:
return return
_tr_if_quit = _translate(
"MainWindow",
" If you quit now, it may cause delivery delays."
" Wait until the synchronization finishes?",
"The second part of string begining with "
"\'Bitmessage hasn't synchronized (connected)...\' "
"Notice the leading space!"
)
if PendingDownloadQueue.totalSize() > 0: if PendingDownloadQueue.totalSize() > 0:
reply = QtGui.QMessageBox.question(self, _translate("MainWindow", "Synchronization pending"), reply = QtGui.QMessageBox.question(
_translate("MainWindow", "Bitmessage hasn't synchronized with the network, %n object(s) to be downloaded. If you quit now, it may cause delivery delays. Wait until the synchronization finishes?", None, _codec, PendingDownloadQueue.totalSize()), self,
QtGui.QMessageBox.Yes|QtGui.QMessageBox.No|QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Cancel) _translate("MainWindow", "Synchronization pending"),
_translate(
"MainWindow",
"Bitmessage hasn't synchronized with the network,"
" %n object(s) to be downloaded.",
None, _codec, PendingDownloadQueue.totalSize()
) + _tr_if_quit,
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No |
QtGui.QMessageBox.Cancel,
QtGui.QMessageBox.Cancel)
if reply == QtGui.QMessageBox.Yes: if reply == QtGui.QMessageBox.Yes:
waitForSync = True waitForSync = True
elif reply == QtGui.QMessageBox.Cancel: elif reply == QtGui.QMessageBox.Cancel:
@ -2754,11 +2803,19 @@ class MyForm(settingsmixin.SMainWindow):
else: else:
PendingDownloadQueue.stop() PendingDownloadQueue.stop()
if shared.statusIconColor == 'red' and not BMConfigParser().safeGetBoolean( if shared.statusIconColor == 'red' \
'bitmessagesettings', 'dontconnect'): and not BMConfigParser().safeGetBoolean(
reply = QtGui.QMessageBox.question(self, _translate("MainWindow", "Not connected"), 'bitmessagesettings', 'dontconnect'):
_translate("MainWindow", "Bitmessage isn't connected to the network. If you quit now, it may cause delivery delays. Wait until connected and the synchronization finishes?"), reply = QtGui.QMessageBox.question(
QtGui.QMessageBox.Yes|QtGui.QMessageBox.No|QtGui.QMessageBox.Cancel, QtGui.QMessageBox.Cancel) self,
_translate("MainWindow", "Not connected"),
_translate(
"MainWindow",
"Bitmessage isn't connected to the network."
) + _tr_if_quit,
QtGui.QMessageBox.Yes | QtGui.QMessageBox.No |
QtGui.QMessageBox.Cancel,
QtGui.QMessageBox.Cancel)
if reply == QtGui.QMessageBox.Yes: if reply == QtGui.QMessageBox.Yes:
waitForConnection = True waitForConnection = True
waitForSync = True waitForSync = True

View File

@ -26,9 +26,6 @@ class NetworkStatus(QtGui.QWidget, RetranslateMixin):
header.setSortIndicator(0, QtCore.Qt.AscendingOrder) header.setSortIndicator(0, QtCore.Qt.AscendingOrder)
self.startup = time.localtime() self.startup = time.localtime()
self.labelStartupTime.setText(_translate(
"networkstatus", "Since startup on %1"
).arg(l10n.formatTimestamp(self.startup)))
self.UISignalThread = UISignaler.get() self.UISignalThread = UISignaler.get()
QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL( QtCore.QObject.connect(self.UISignalThread, QtCore.SIGNAL(

View File

@ -182,7 +182,7 @@
</size> </size>
</property> </property>
<property name="text"> <property name="text">
<string>Since startup:</string> <string notr="true">Since startup:</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>