Add more missing unicode()s around .tr()s

Fixes https://github.com/QubesOS/qubes-issues/issues/2637
This commit is contained in:
Jean-Philippe Ouellet 2017-02-19 21:36:35 -05:00
parent ed8f889c92
commit 2f72aaf05f
No known key found for this signature in database
GPG Key ID: 4747332C27533622
4 changed files with 9 additions and 9 deletions

View File

@ -289,8 +289,8 @@ class BackupVMsWindow(Ui_Backup, QWizard):
if self.appvm_combobox.currentIndex() == 0 and \
not os.path.isdir(backup_location):
QMessageBox.information(None, self.tr("Wait!"),
self.tr("Selected directory do not exists or "
"not a directory (%s).") % backup_location)
unicode(self.tr("Selected directory do not exists or "
"not a directory (%s).")) % backup_location)
return False
if not len(self.passphrase_line_edit.text()):
QMessageBox.information(None, self.tr("Wait!"),
@ -384,8 +384,8 @@ class BackupVMsWindow(Ui_Backup, QWizard):
self.progress_status.setText(self.tr("Backup aborted."))
if self.tmpdir_to_remove:
if QMessageBox.warning(None, self.tr("Backup aborted"),
self.tr("Do you want to remove temporary files from "
"%s?") % self.tmpdir_to_remove,
unicode(self.tr("Do you want to remove temporary files from "
"%s?")) % self.tmpdir_to_remove,
QMessageBox.Yes, QMessageBox.No) == QMessageBox.Yes:
shutil.rmtree(self.tmpdir_to_remove)
else:

View File

@ -56,7 +56,7 @@ class LogDialog(Ui_LogDialog, QDialog):
log = open(self.log_path)
log.seek(0, os.SEEK_END)
if log.tell() > LOG_DISPLAY_SIZE:
self.displayed_text = self.tr("(Showing only last %d bytes of file)\n") % LOG_DISPLAY_SIZE
self.displayed_text = unicode(self.tr("(Showing only last %d bytes of file)\n")) % LOG_DISPLAY_SIZE
log.seek(-LOG_DISPLAY_SIZE, os.SEEK_END)
else:
log.seek(0, os.SEEK_SET)

View File

@ -1217,7 +1217,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
vm.name, thread_monitor.error_msg),
msecs=3000)
self.set_error(vm.qid,
self.tr("Error starting VM: %s") % thread_monitor.error_msg)
unicode(self.tr("Error starting VM: %s")) % thread_monitor.error_msg)
@staticmethod
def do_start_vm(vm, thread_monitor):
@ -1267,7 +1267,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow):
.format(vm.name, thread_monitor.error_msg),
msecs=3000)
self.set_error(vm.qid,
self.tr("Error starting VM: %s") % thread_monitor.error_msg)
unicode(self.tr("Error starting VM: %s")) % thread_monitor.error_msg)
# noinspection PyMethodMayBeStatic
def do_start_vm_tools_install(self, vm, thread_monitor):

View File

@ -265,8 +265,8 @@ class RestoreVMsWindow(Ui_Restore, QWizard):
if self.canceled:
if self.tmpdir_to_remove and \
QMessageBox.warning(None, self.tr("Restore aborted"),
self.tr("Do you want to remove temporary files "
"from %s?") % self.tmpdir_to_remove,
unicode(self.tr("Do you want to remove temporary files "
"from %s?")) % self.tmpdir_to_remove,
QMessageBox.Yes, QMessageBox.No) == \
QMessageBox.Yes:
shutil.rmtree(self.tmpdir_to_remove)