From cf8b99c763cfdd337357aa3b523de5f3177cd9c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 22 Jan 2017 04:43:13 +0100 Subject: [PATCH 1/7] i18n: add basic support for translations Handle translations of GUI elements defined in .ui files. See README.md for details. Fixes QubesOS/qubes-issues#2599 --- Makefile | 6 ++++++ README.md | 21 ++++++++++++++++++++ i18n/.gitignore | 1 + qubesmanager.pro | 47 ++++++++++++++++++++++++++++++++++++++++++++ qubesmanager/main.py | 8 ++++++++ rpm_spec/qmgr.spec | 6 +++++- 6 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 README.md create mode 100644 i18n/.gitignore create mode 100644 qubesmanager.pro diff --git a/Makefile b/Makefile index 3563e89..ecfd26f 100644 --- a/Makefile +++ b/Makefile @@ -30,6 +30,12 @@ res: pyuic4 -o qubesmanager/ui_about.py about.ui pyuic4 -o qubesmanager/ui_releasenotes.py releasenotes.ui +translations: + lrelease-qt4 qubesmanager.pro + +update_ts: res + pylupdate4 qubesmanager.pro + update-repo-current: ln -f $(RPMS_DIR)/x86_64/qubes-manager-*$(VERSION)*.rpm ../yum/current-release/current/dom0/rpm/ diff --git a/README.md b/README.md new file mode 100644 index 0000000..8071c89 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +Qubes Manager +============== + +Managing translations +---------------------- + +### Adding new language + +1. Add `i18n/qubesmanager_LANGUAGECODE.ts` (replace `LANGUAGECODE` with actual code, + for example `es`) to `qubesmanager.pro` - `TRANSLATIONS` setting. +2. Run `make res update_ts` + +### Regenerating translation source files (`.ts`) + + make res update_ts + +This will keep translated strings, but will add new ones. + +### Updating translations + +Commit updated `.ts` files into `i18n` directory. diff --git a/i18n/.gitignore b/i18n/.gitignore new file mode 100644 index 0000000..8df47d5 --- /dev/null +++ b/i18n/.gitignore @@ -0,0 +1 @@ +*.qm diff --git a/qubesmanager.pro b/qubesmanager.pro new file mode 100644 index 0000000..f0d826f --- /dev/null +++ b/qubesmanager.pro @@ -0,0 +1,47 @@ +SOURCES = \ + about.ui \ + backupdlg.ui \ + globalsettingsdlg.ui \ + logdlg.ui \ + mainwindow.ui \ + multiselectwidget.ui \ + newappvmdlg.ui \ + newfwruledlg.ui \ + releasenotes.ui \ + restoredlg.ui \ + settingsdlg.ui \ + qubesmanager/about.py \ + qubesmanager/appmenu_select.py \ + qubesmanager/backup.py \ + qubesmanager/backup_utils.py \ + qubesmanager/block.py \ + qubesmanager/clipboard.py \ + qubesmanager/create_new_vm.py \ + qubesmanager/firewall.py \ + qubesmanager/global_settings.py \ + qubesmanager/log_dialog.py \ + qubesmanager/main.py \ + qubesmanager/multiselectwidget.py \ + qubesmanager/releasenotes.py \ + qubesmanager/resources_rc.py \ + qubesmanager/restore.py \ + qubesmanager/settings.py \ + qubesmanager/table_widgets.py \ + qubesmanager/thread_monitor.py \ + qubesmanager/ui_about.py \ + qubesmanager/ui_backupdlg.py \ + qubesmanager/ui_globalsettingsdlg.py \ + qubesmanager/ui_logdlg.py \ + qubesmanager/ui_mainwindow.py \ + qubesmanager/ui_multiselectwidget.py \ + qubesmanager/ui_newappvmdlg.py \ + qubesmanager/ui_newfwruledlg.py \ + qubesmanager/ui_releasenotes.py \ + qubesmanager/ui_restoredlg.py \ + qubesmanager/ui_settingsdlg.py + +TRANSLATIONS = + + +CODECFORTR = UTF-8 +CODECFORSRC = UTF-8 diff --git a/qubesmanager/main.py b/qubesmanager/main.py index 007ae07..f44e2f8 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -2114,6 +2114,14 @@ def main(): app.setWindowIcon(QIcon.fromTheme("qubes-manager")) app.setAttribute(Qt.AA_DontShowIconsInMenus, False) + qt_translator = QTranslator() + locale = QLocale.system().name() + i18n_dir = os.path.join( + os.path.dirname(os.path.realpath(__file__)), + 'i18n') + qt_translator.load("qubesmanager_{!s}.qm".format(locale), i18n_dir) + app.installTranslator(qt_translator) + sys.excepthook = handle_exception global session_bus diff --git a/rpm_spec/qmgr.spec b/rpm_spec/qmgr.spec index ae64117..4784464 100644 --- a/rpm_spec/qmgr.spec +++ b/rpm_spec/qmgr.spec @@ -24,7 +24,7 @@ AutoReq: 0 The Graphical Qubes VM Manager. %build -make res +make res translations python -m compileall qubesmanager python -O -m compileall qubesmanager @@ -68,6 +68,9 @@ cp qubesmanager/ui_logdlg.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanage cp qubesmanager/ui_about.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager cp qubesmanager/ui_releasenotes.py{,c,o} $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager +mkdir -p $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager/i18n +cp i18n/qubesmanager_*.qm $RPM_BUILD_ROOT%{python_sitearch}/qubesmanager/i18n/ + mkdir -p $RPM_BUILD_ROOT/usr/share/applications cp qubes-manager.desktop $RPM_BUILD_ROOT/usr/share/applications mkdir -p $RPM_BUILD_ROOT/etc/xdg/autostart/ @@ -182,6 +185,7 @@ rm -rf $RPM_BUILD_ROOT %{python_sitearch}/qubesmanager/ui_releasenotes.py %{python_sitearch}/qubesmanager/ui_releasenotes.pyc %{python_sitearch}/qubesmanager/ui_releasenotes.pyo +%{python_sitearch}/qubesmanager/i18n/qubesmanager_*.qm /usr/share/applications/qubes-manager.desktop From 7c602bf7d2899d3d79fc44c19b3f9a0ea68971e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 22 Jan 2017 05:42:38 +0100 Subject: [PATCH 2/7] i18n: wrap strings with self.tr Allow translations to handle strings defined in code. Fixes QubesOS/qubes-issues#2599 --- qubesmanager/backup.py | 63 ++++++---- qubesmanager/backup_utils.py | 6 +- qubesmanager/create_new_vm.py | 27 ++-- qubesmanager/firewall.py | 4 +- qubesmanager/global_settings.py | 12 +- qubesmanager/log_dialog.py | 2 +- qubesmanager/main.py | 212 +++++++++++++++++--------------- qubesmanager/restore.py | 40 +++--- qubesmanager/settings.py | 74 +++++++---- qubesmanager/table_widgets.py | 14 ++- 10 files changed, 258 insertions(+), 196 deletions(-) diff --git a/qubesmanager/backup.py b/qubesmanager/backup.py index cec3d30..ea8f9bc 100644 --- a/qubesmanager/backup.py +++ b/qubesmanager/backup.py @@ -78,7 +78,7 @@ class BackupVMsWindow(Ui_Backup, QWizard): self.setupUi(self) - self.progress_status.text = "Backup in progress..." + self.progress_status.text = self.tr("Backup in progress...") self.show_running_vms_warning(False) self.dir_line_edit.setReadOnly(False) @@ -224,10 +224,12 @@ class BackupVMsWindow(Ui_Backup, QWizard): for vm in vms: self.blk_manager.check_if_serves_as_backend(vm) - reply = QMessageBox.question(None, "VM Shutdown Confirmation", - "Are you sure you want to power down the following VMs: {0}?
" - "This will shutdown all the running applications within them.".format(', '.join(names)), - QMessageBox.Yes | QMessageBox.Cancel) + reply = QMessageBox.question(None, self.tr("VM Shutdown Confirmation"), + self.tr("Are you sure you want to power down the following VMs: " + "{0}?
" + "This will shutdown all the running applications " + "within them.").format(', '.join(names)), + QMessageBox.Yes | QMessageBox.Cancel) self.app.processEvents() @@ -266,7 +268,11 @@ class BackupVMsWindow(Ui_Backup, QWizard): def validateCurrentPage(self): if self.currentPage() is self.select_vms_page: if self.check_running(): - QMessageBox.information(None, "Wait!", "Some selected VMs are running. Running VMs can not be backuped. Please shut them down or remove them from the list.") + QMessageBox.information(None, + self.tr("Wait!"), + self.tr("Some selected VMs are running. " + "Running VMs can not be backuped. " + "Please shut them down or remove them from the list.")) return False self.selected_vms = [] @@ -276,18 +282,23 @@ class BackupVMsWindow(Ui_Backup, QWizard): elif self.currentPage() is self.select_dir_page: backup_location = str(self.dir_line_edit.text()) if not backup_location: - QMessageBox.information(None, "Wait!", "Enter backup target location first.") + QMessageBox.information(None, self.tr("Wait!"), + self.tr("Enter backup target location first.")) return False if self.appvm_combobox.currentIndex() == 0 and \ not os.path.isdir(backup_location): - QMessageBox.information(None, "Wait!", - "Selected directory do not exists or not a directory (%s)." % backup_location) + QMessageBox.information(None, self.tr("Wait!"), + 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, "Wait!", "Enter passphrase for backup encryption/verification first.") + QMessageBox.information(None, self.tr("Wait!"), + self.tr("Enter passphrase for backup encryption/verification first.")) return False if self.passphrase_line_edit.text() != self.passphrase_line_edit_verify.text(): - QMessageBox.information(None, "Wait!", "Enter the same passphrase in both fields.") + QMessageBox.information(None, + self.tr("Wait!"), + self.tr("Enter the same passphrase in both fields.")) return False return True @@ -315,7 +326,7 @@ class BackupVMsWindow(Ui_Backup, QWizard): if ex.tmpdir: self.tmpdir_to_remove = ex.tmpdir except Exception as ex: - print "Exception:",ex + print "Exception:", ex msg.append(str(ex)) if len(msg) > 0 : @@ -340,8 +351,10 @@ class BackupVMsWindow(Ui_Backup, QWizard): print_callback = self.gather_output, hide_vm_names=self.encryption_checkbox.isChecked()) except Exception as ex: - print "Exception:",ex - QMessageBox.critical(None, "Error while preparing backup.", "ERROR: {0}".format(ex)) + print "Exception:", ex + QMessageBox.critical(None, + self.tr("Error while preparing backup."), + self.tr("ERROR: {0}").format(ex)) self.textEdit.setReadOnly(True) self.textEdit.setFontFamily("Monospace") @@ -367,25 +380,27 @@ class BackupVMsWindow(Ui_Backup, QWizard): if not self.thread_monitor.success: if self.canceled: - self.progress_status.setText("Backup aborted.") + self.progress_status.setText(self.tr("Backup aborted.")) if self.tmpdir_to_remove: - if QMessageBox.warning(None, "Backup aborted", - "Do you want to remove temporary files from " - "%s?" % 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, QMessageBox.Yes, QMessageBox.No) == QMessageBox.Yes: shutil.rmtree(self.tmpdir_to_remove) else: - self.progress_status.setText("Backup error.") - QMessageBox.warning (self, "Backup error!", "ERROR: {}".format( + self.progress_status.setText(self.tr("Backup error.")) + QMessageBox.warning(self, self.tr("Backup error!"), + self.tr("ERROR: {}").format( self.thread_monitor.error_msg)) else: self.progress_bar.setValue(100) - self.progress_status.setText("Backup finished.") + self.progress_status.setText(self.tr("Backup finished.")) if self.showFileDialog.isChecked(): orig_text = self.progress_status.text self.progress_status.setText( - orig_text + " Please unmount your backup volume and cancel " - "the file selection dialog.") + orig_text + self.tr( + " Please unmount your backup volume and cancel " + "the file selection dialog.")) if self.target_appvm: self.target_appvm.run("QUBESRPC %s dom0" % "qubes" ".SelectDirectory") @@ -420,7 +435,7 @@ class BackupVMsWindow(Ui_Backup, QWizard): # Bases on the original code by: # Copyright (c) 2002-2007 Pascal Varet -def handle_exception( exc_type, exc_value, exc_traceback ): +def handle_exception(exc_type, exc_value, exc_traceback ): import sys import os.path import traceback diff --git a/qubesmanager/backup_utils.py b/qubesmanager/backup_utils.py index 8bffe1e..84e2e32 100644 --- a/qubesmanager/backup_utils.py +++ b/qubesmanager/backup_utils.py @@ -90,9 +90,9 @@ def select_path_button_clicked(dialog, select_file = False): new_path = get_path_for_vm(vm, "qubes.SelectFile" if select_file else "qubes.SelectDirectory") else: - new_path = file_dialog_function(dialog, "Select backup location.", - backup_location if backup_location - else '/') + new_path = file_dialog_function(dialog, + dialog.tr("Select backup location."), + backup_location if backup_location else '/') if new_path != None: new_path = unicode(new_path) diff --git a/qubesmanager/create_new_vm.py b/qubesmanager/create_new_vm.py index cc7c62a..997d79c 100644 --- a/qubesmanager/create_new_vm.py +++ b/qubesmanager/create_new_vm.py @@ -99,7 +99,7 @@ class NewVmDlg (QDialog, Ui_NewVMDlg): for (i, vm) in enumerate(self.template_vm_list): if vm is self.qvm_collection.get_default_template(): default_index = i - self.template_name.insertItem(i, vm.name + " (default)") + self.template_name.insertItem(i, vm.name + self.tr(" (default)")) else: self.template_name.insertItem(i, vm.name) self.template_name.setCurrentIndex(default_index) @@ -123,7 +123,7 @@ class NewVmDlg (QDialog, Ui_NewVMDlg): for (i, vm) in enumerate(self.netvm_list): if vm is self.qvm_collection.get_default_netvm(): default_index = i - self.netvm_name.insertItem(i, vm.name + " (default)") + self.netvm_name.insertItem(i, vm.name + self.tr(" (default)")) else: self.netvm_name.insertItem(i, vm.name) self.netvm_name.setCurrentIndex(default_index) @@ -187,7 +187,10 @@ class NewVmDlg (QDialog, Ui_NewVMDlg): def accept(self): vmname = str(self.vmname.text()) if self.qvm_collection.get_vm_by_name(vmname) is not None: - QMessageBox.warning (None, "Incorrect AppVM Name!", "A VM with the name {0} already exists in the system!".format(vmname)) + QMessageBox.warning(None, + self.tr("Incorrect AppVM Name!"), + self.tr("A VM with the name {0} already exists in the " + "system!").format(vmname)) return label = self.label_list[self.vmlabel.currentIndex()] @@ -195,7 +198,11 @@ class NewVmDlg (QDialog, Ui_NewVMDlg): template_vm = None if self.template_name.isEnabled(): if len(self.template_vm_list) == 0: - QMessageBox.warning (None, "No template available!", "Cannot create non-standalone VM when no compatible template exists. Create template VM first or choose to create standalone VM.") + QMessageBox.warning(None, + self.tr("No template available!"), + self.tr("Cannot create non-standalone VM when no " + "compatible template exists. Create template VM " + "first or choose to create standalone VM.")) return template_vm = self.template_vm_list[self.template_name.currentIndex()] @@ -220,8 +227,9 @@ class NewVmDlg (QDialog, Ui_NewVMDlg): elif self.hvmtpl_radio.isChecked(): vmtype = "TemplateHVM" else: - QErrorMessage.showMessage(None, "Error creating AppVM!", "Unknown " - "VM type, this is error in Qubes Manager") + QErrorMessage.showMessage(None, + self.tr("Error creating AppVM!"), + self.tr("Unknown VM type, this is error in Qubes Manager")) self.done(0) @@ -231,7 +239,8 @@ class NewVmDlg (QDialog, Ui_NewVMDlg): thread.daemon = True thread.start() - progress = QProgressDialog ("Creating new {0} {1}...".format(vmtype, vmname), "", 0, 0) + progress = QProgressDialog( + self.tr("Creating new {0} {1}...").format(vmtype, vmname), "", 0, 0) progress.setCancelButton(None) progress.setModal(True) progress.show() @@ -246,7 +255,9 @@ class NewVmDlg (QDialog, Ui_NewVMDlg): self.trayIcon.showMessage( "VM '{0}' has been created.".format(vmname), msecs=3000) else: - QMessageBox.warning (None, "Error creating AppVM!", "ERROR: {0}".format(thread_monitor.error_msg)) + QMessageBox.warning(None, + self.tr("Error creating AppVM!"), + self.tr("ERROR: {0}").format(thread_monitor.error_msg)) self.done(0) diff --git a/qubesmanager/firewall.py b/qubesmanager/firewall.py index 36440a9..162584e 100644 --- a/qubesmanager/firewall.py +++ b/qubesmanager/firewall.py @@ -92,8 +92,8 @@ class NewFwRuleDlg (QDialog, ui_newfwruledlg.Ui_NewFwRuleDlg): if self.tcp_radio.isChecked() or self.udp_radio.isChecked(): if len(self.serviceComboBox.currentText()) == 0: msg = QMessageBox() - msg.warning(self, "Firewall rule", - "You need to fill service name/port for TCP/UDP rule") + msg.warning(self, self.tr("Firewall rule"), + self.tr("You need to fill service name/port for TCP/UDP rule")) return QDialog.accept(self) diff --git a/qubesmanager/global_settings.py b/qubesmanager/global_settings.py index 286df03..62e689d 100644 --- a/qubesmanager/global_settings.py +++ b/qubesmanager/global_settings.py @@ -82,7 +82,7 @@ class GlobalSettingsWindow(Ui_GlobalSettings, QDialog): text = vm.name if vm is current_update_vm: self.updatevm_idx = i - text += " (current)" + text += self.tr(" (current)") self.update_vm_combo.insertItem(i, text) self.update_vm_combo.insertItem(len(all_vms), "none") if current_update_vm is None: @@ -97,7 +97,7 @@ class GlobalSettingsWindow(Ui_GlobalSettings, QDialog): text = vm.name if vm is current_clock_vm: self.clockvm_idx = i - text += " (current)" + text += self.tr(" (current)") self.clock_vm_combo.insertItem(i, text) self.clock_vm_combo.insertItem(len(all_vms), "none") if current_clock_vm is None: @@ -113,7 +113,7 @@ class GlobalSettingsWindow(Ui_GlobalSettings, QDialog): text = vm.name if vm is current_netvm: self.netvm_idx = i - text += " (current)" + text += self.tr(" (current)") self.default_netvm_combo.insertItem(i, text) if current_netvm is not None: self.default_netvm_combo.setCurrentIndex(self.netvm_idx) @@ -127,7 +127,7 @@ class GlobalSettingsWindow(Ui_GlobalSettings, QDialog): text = vm.name if vm is current_template: self.template_idx = i - text += " (current)" + text += self.tr(" (current)") self.default_template_combo.insertItem(i, text) if current_template is not None: self.default_template_combo.setCurrentIndex(self.template_idx) @@ -180,9 +180,9 @@ class GlobalSettingsWindow(Ui_GlobalSettings, QDialog): for (i, k) in enumerate(kernel_list): text = k if k == self.qvm_collection.get_default_kernel(): - text += " (current)" + text += self.tr(" (current)") self.kernel_idx = i - self.default_kernel_combo.insertItem(i,text) + self.default_kernel_combo.insertItem(i, text) self.default_kernel_combo.setCurrentIndex(self.kernel_idx) def __apply_kernel_defaults__(self): diff --git a/qubesmanager/log_dialog.py b/qubesmanager/log_dialog.py index 41296fc..61ef469 100644 --- a/qubesmanager/log_dialog.py +++ b/qubesmanager/log_dialog.py @@ -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 = "(Showing only last %d bytes of file)\n" % LOG_DISPLAY_SIZE + self.displayed_text = 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) diff --git a/qubesmanager/main.py b/qubesmanager/main.py index f44e2f8..6f8405d 100755 --- a/qubesmanager/main.py +++ b/qubesmanager/main.py @@ -95,16 +95,16 @@ class QubesManagerFileWatcher(ProcessEvent): src_info_file = open(qubes_clipboard_info_file, 'r') src_vmname = src_info_file.readline().strip('\n') if src_vmname == "": - trayIcon.showMessage( + trayIcon.showMessage(self.tr( "Qubes Clipboard has been copied to the VM and wiped.\n" "Trigger a paste operation (e.g. Ctrl-v) to insert " - "it into an application.", + "it into an application."), msecs=3000) else: - trayIcon.showMessage( + trayIcon.showMessage(self.tr( "Qubes Clipboard fetched from VM: '{0}'\n" "Press Ctrl-Shift-v to copy this clipboard into dest" - " VM's clipboard.".format( + " VM's clipboard.").format( src_vmname), msecs=3000) src_info_file.close() @@ -116,7 +116,8 @@ class QubesManagerFileWatcher(ProcessEvent): EventsCodes.OP_FLAGS.get('IN_CLOSE_WRITE')) elif event.name == os.path.basename(table_widgets .qubes_dom0_updates_stat_file): - trayIcon.showMessage("Qubes dom0 updates available.", msecs=0) + trayIcon.showMessage(self.tr("Qubes dom0 updates available."), + msecs=0) class SearchBox(QLineEdit): @@ -279,12 +280,12 @@ class VmShutdownMonitor(QObject): if (datetime.now() - self.shutdown_started) > \ timedelta(milliseconds=self.shutdown_time): reply = QMessageBox.question( - None, "VM Shutdown", - "The VM '{0}' hasn't shutdown within the last " - "{1} seconds, do you want to kill it?
".format( + None, self.tr("VM Shutdown"), + self.tr("The VM '{0}' hasn't shutdown within the last " + "{1} seconds, do you want to kill it?
").format( vm.name, self.shutdown_time / 1000), - "Kill it!", - "Wait another {0} seconds...".format( + self.tr("Kill it!"), + self.tr("Wait another {0} seconds...").format( self.shutdown_time / 1000)) if reply == 0: vm.force_shutdown() @@ -1027,21 +1028,21 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): dependent_vms = self.qvm_collection.get_vms_based_on(vm.qid) if len(dependent_vms) > 0: QMessageBox.warning( - None, "Warning!", - "This Template VM cannot be removed, because there is at " + None, self.tr("Warning!"), + self.tr("This Template VM cannot be removed, because there is at " "least one AppVM that is based on it.
" "If you want to remove this Template VM and all " "the AppVMs based on it," "you should first remove each individual AppVM that uses " - "this template.") + "this template.")) return (requested_name, ok) = QInputDialog.getText( - None, "VM Removal Confirmation", - "Are you sure you want to remove the VM '{0}'?
" + None, self.tr("VM Removal Confirmation"), + self.tr("Are you sure you want to remove the VM '{0}'?
" "All data on this VM's private storage will be lost!

" - "Type the name of the VM ({1}) below to confirm:" + "Type the name of the VM ({1}) below to confirm:") .format(vm.name, vm.name)) if not ok: @@ -1050,8 +1051,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): elif requested_name != vm.name: # name did not match - QMessageBox.warning(None, "VM removal confirmation failed", - "Entered name did not match! Not removing {0}.".format(vm.name)) + QMessageBox.warning(None, self.tr("VM removal confirmation failed"), + self.tr("Entered name did not match! Not removing {0}.").format(vm.name)) return else: @@ -1063,7 +1064,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): thread.start() progress = QProgressDialog( - "Removing VM: {0}...".format(vm.name), "", 0, 0) + self.tr("Removing VM: {0}...").format(vm.name), "", 0, 0) progress.setCancelButton(None) progress.setModal(True) progress.show() @@ -1076,10 +1077,10 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): if thread_monitor.success: trayIcon.showMessage( - "VM '{0}' has been removed.".format(vm.name), msecs=3000) + self.tr("VM '{0}' has been removed.").format(vm.name), msecs=3000) else: - QMessageBox.warning(None, "Error removing VM!", - "ERROR: {0}".format( + QMessageBox.warning(None, self.tr("Error removing VM!"), + self.tr("ERROR: {0}").format( thread_monitor.error_msg)) @staticmethod @@ -1119,8 +1120,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): name_number += 1 (clone_name, ok) = QInputDialog.getText( - self, 'Qubes clone VM', - 'Enter name for VM ' + vm.name + ' clone:', + self, self.tr('Qubes clone VM'), + self.tr('Enter name for VM {} clone:').format(vm.name), text=(name_format % name_number)) if not ok or clone_name == "": return @@ -1132,7 +1133,7 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): thread.start() progress = QProgressDialog( - "Cloning VM {0} to {1}...".format(vm.name, + self.tr("Cloning VM {0} to {1}...").format(vm.name, clone_name), "", 0, 0) progress.setCancelButton(None) @@ -1146,8 +1147,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): progress.hide() if not thread_monitor.success: - QMessageBox.warning(None, "Error while cloning VM", - "Exception while cloning:
{0}".format( + QMessageBox.warning(None, self.tr("Error while cloning VM"), + self.tr("Exception while cloning:
{0}").format( thread_monitor.error_msg)) @staticmethod @@ -1184,8 +1185,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): try: vm.resume() except Exception as ex: - QMessageBox.warning(None, "Error unpausing VM!", - "ERROR: {0}".format(ex)) + QMessageBox.warning(None, self.tr("Error unpausing VM!"), + self.tr("ERROR: {0}").format(ex)) return @@ -1199,22 +1200,22 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): thread.daemon = True thread.start() - trayIcon.showMessage("Starting '{0}'...".format(vm.name), msecs=3000) + trayIcon.showMessage(self.tr("Starting '{0}'...").format(vm.name), msecs=3000) while not thread_monitor.is_finished(): app.processEvents() time.sleep(0.1) if thread_monitor.success: - trayIcon.showMessage("VM '{0}' has been started.".format(vm.name), + trayIcon.showMessage(self.tr("VM '{0}' has been started.").format(vm.name), msecs=3000) else: trayIcon.showMessage( - "Error starting VM '{0}': {1}".format( + self.tr("Error starting VM '{0}': {1}").format( vm.name, thread_monitor.error_msg), msecs=3000) self.set_error(vm.qid, - "Error starting VM: %s" % thread_monitor.error_msg) + self.tr("Error starting VM: %s") % thread_monitor.error_msg) @staticmethod def do_start_vm(vm, thread_monitor): @@ -1236,9 +1237,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): os.path.exists('/usr/lib/qubes/qubes-windows-tools.iso') if not windows_tools_installed: msg = QMessageBox() - msg.warning(self, "Error starting VM!", - "You need to install 'qubes-windows-tools' " - "package to use this option") + msg.warning(self, self.tr("Error starting VM!"), + self.tr("You need to install 'qubes-windows-tools' " + "package to use this option")) return @@ -1248,23 +1249,23 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): thread.daemon = True thread.start() - trayIcon.showMessage("Starting '{0}'...".format(vm.name), msecs=3000) + trayIcon.showMessage(self.tr("Starting '{0}'...").format(vm.name), msecs=3000) while not thread_monitor.is_finished(): app.processEvents() time.sleep(0.1) if thread_monitor.success: - trayIcon.showMessage("VM '{0}' has been started. Start Qubes " - "Tools installation from attached CD" + trayIcon.showMessage(self.tr("VM '{0}' has been started. Start Qubes " + "Tools installation from attached CD") .format(vm.name), msecs=3000) else: trayIcon.showMessage( - "Error starting VM '{0}': {1}" + self.tr("Error starting VM '{0}': {1}") .format(vm.name, thread_monitor.error_msg), msecs=3000) self.set_error(vm.qid, - "Error starting VM: %s" % thread_monitor.error_msg) + self.tr("Error starting VM: %s") % thread_monitor.error_msg) # noinspection PyMethodMayBeStatic def do_start_vm_tools_install(self, vm, thread_monitor): @@ -1288,8 +1289,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): try: vm.pause() except Exception as ex: - QMessageBox.warning(None, "Error pausing VM!", - "ERROR: {0}".format(ex)) + QMessageBox.warning(None, self.tr("Error pausing VM!"), + self.tr("ERROR: {0}").format(ex)) return @pyqtSlot(name='on_action_shutdownvm_triggered') @@ -1300,10 +1301,10 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): self.blk_manager.check_if_serves_as_backend(vm) reply = QMessageBox.question( - None, "VM Shutdown Confirmation", - "Are you sure you want to power down the VM '{0}'?
" + None, self.tr("VM Shutdown Confirmation"), + self.tr("Are you sure you want to power down the VM '{0}'?
" "This will shutdown all the running applications " - "within this VM.".format(vm.name), + "within this VM.").format(vm.name), QMessageBox.Yes | QMessageBox.Cancel) app.processEvents() @@ -1316,11 +1317,11 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): try: vm.shutdown() except Exception as ex: - QMessageBox.warning(None, "Error shutting down VM!", - "ERROR: {0}".format(ex)) + QMessageBox.warning(None, self.tr("Error shutting down VM!"), + self.tr("ERROR: {0}").format(ex)) return - trayIcon.showMessage("VM '{0}' is shutting down...".format(vm.name), + trayIcon.showMessage(self.tr("VM '{0}' is shutting down...").format(vm.name), msecs=3000) self.shutdown_monitor[vm.qid] = VmShutdownMonitor(vm, shutdown_time, @@ -1337,10 +1338,10 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): self.blk_manager.check_if_serves_as_backend(vm) reply = QMessageBox.question( - None, "VM Restart Confirmation", - "Are you sure you want to restart the VM '{0}'?
" + None, self.tr("VM Restart Confirmation"), + self.tr("Are you sure you want to restart the VM '{0}'?
" "This will shutdown all the running applications " - "within this VM.".format(vm.name), + "within this VM.").format(vm.name), QMessageBox.Yes | QMessageBox.Cancel) app.processEvents() @@ -1354,10 +1355,10 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): assert vm.is_running() or vm.is_paused() reply = QMessageBox.question( - None, "VM Kill Confirmation", - "Are you sure you want to kill the VM '{0}'?
" + None, self.tr("VM Kill Confirmation"), + self.tr("Are you sure you want to kill the VM '{0}'?
" "This will end (not shutdown!) all the running " - "applications within this VM.".format(vm.name), + "applications within this VM.").format(vm.name), QMessageBox.Yes | QMessageBox.Cancel, QMessageBox.Cancel) @@ -1368,9 +1369,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): vm.force_shutdown() except Exception as ex: QMessageBox.critical( - None, "Error while killing VM!", - "An exception ocurred while killing {0}.
" - "ERROR: {1}".format(vm.name, ex)) + None, self.tr("Error while killing VM!"), + self.tr("An exception ocurred while killing {0}.
" + "ERROR: {1}").format(vm.name, ex)) return trayIcon.showMessage("VM '{0}' killed!".format(vm.name), msecs=3000) @@ -1430,13 +1431,13 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): if not vm.is_running(): reply = QMessageBox.question( - None, "VM Update Confirmation", - "{0}
The VM has to be running to be updated.
" - "Do you want to start it?
".format(vm.name), + None, self.tr("VM Update Confirmation"), + self.tr("{0}
The VM has to be running to be updated.
" + "Do you want to start it?
").format(vm.name), QMessageBox.Yes | QMessageBox.Cancel) if reply != QMessageBox.Yes: return - trayIcon.showMessage("Starting '{0}'...".format(vm.name), + trayIcon.showMessage(self.tr("Starting '{0}'...").format(vm.name), msecs=3000) app.processEvents() @@ -1448,8 +1449,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): thread.start() progress = QProgressDialog( - "{0}
Please wait for the updater to launch...".format( - vm.name), "", 0, 0) + self.tr("{0}
Please wait for the updater to launch..."). + format(vm.name), "", 0, 0) progress.setCancelButton(None) progress.setModal(True) progress.show() @@ -1462,8 +1463,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): if vm.qid != 0: if not thread_monitor.success: - QMessageBox.warning(None, "Error VM update!", - "ERROR: {0}".format( + QMessageBox.warning(None, self.tr("Error VM update!"), + self.tr("ERROR: {0}").format( thread_monitor.error_msg)) @staticmethod @@ -1492,8 +1493,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): vm = self.get_selected_vm() (command_to_run, ok) = QInputDialog.getText( - self, 'Qubes command entry', - 'Run command in ' + vm.name + ':') + self, self.tr('Qubes command entry'), + self.tr('Run command in {}:').format(vm.name)) if not ok or command_to_run == "": return thread_monitor = ThreadMonitor() @@ -1507,9 +1508,9 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): time.sleep(0.2) if not thread_monitor.success: - QMessageBox.warning(None, "Error while running command", - "Exception while running command:
{0}".format( - thread_monitor.error_msg)) + QMessageBox.warning(None, self.tr("Error while running command"), + self.tr("Exception while running command:
{0}").format( + thread_monitor.error_msg)) @staticmethod def do_run_command_in_vm(vm, command_to_run, thread_monitor): @@ -1718,9 +1719,11 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): for d in self.blk_manager.attached_devs: if (self.blk_manager.attached_devs[d] ['attached_to']['vm'].qid == vm.qid): - text = "Detach " + d + " " + unicode( - self.blk_manager.attached_devs[d]['size']) + " " + \ - self.blk_manager.attached_devs[d]['desc'] + text = self.tr("Detach {dev} {size} {desc}").format( + dev=d, + size=unicode( + self.blk_manager.attached_devs[d]['size']), + desc=self.blk_manager.attached_devs[d]['desc']) action = self.blk_menu.addAction(QIcon(":/remove.png"), text) action.setData(QVariant(d)) @@ -1733,9 +1736,11 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): if d[-1].isdigit() and \ d[0:-1] in self.blk_manager.current_blk: continue - text = "Attach " + d + " " + unicode( - self.blk_manager.free_devs[d]['size']) + " " + \ - self.blk_manager.free_devs[d]['desc'] + text = self.tr("Attach {dev} {size} {desc}").format( + dev=d, + size=unicode( + self.blk_manager.free_devs[d]['size']), + desc=self.blk_manager.free_devs[d]['desc']) action = self.blk_menu.addAction(QIcon(":/add.png"), text) action.setData(QVariant(d)) @@ -1766,7 +1771,8 @@ class VmManagerWindow(Ui_VmManagerWindow, QMainWindow): self.blk_manager.blk_lock.release() except QubesException as e: self.blk_manager.blk_lock.release() - QMessageBox.critical(None, "Block attach/detach error!", str(e)) + QMessageBox.critical(None, + self.tr("Block attach/detach error!"), str(e)) class QubesTrayIcon(QSystemTrayIcon): @@ -1774,16 +1780,18 @@ class QubesTrayIcon(QSystemTrayIcon): QSystemTrayIcon.__init__(self, icon) self.menu = QMenu() - action_showmanager = self.create_action("Open VM Manager", - slot=show_manager, icon="qubes") - action_copy = self.create_action("Copy Dom0 clipboard", icon="copy", - slot=do_dom0_copy) - action_backup = self.create_action("Make backup") - action_preferences = self.create_action("Preferences") - action_set_netvm = self.create_action("Set default NetVM", + action_showmanager = self.create_action( + self.tr("Open VM Manager"), + slot=show_manager, icon="qubes") + action_copy = self.create_action( + self.tr("Copy Dom0 clipboard"), icon="copy", + slot=do_dom0_copy) + action_backup = self.create_action(self.tr("Make backup")) + action_preferences = self.create_action(self.tr("Preferences")) + action_set_netvm = self.create_action(self.tr("Set default NetVM"), icon="networking") - action_sys_info = self.create_action("System Info", icon="dom0") - action_exit = self.create_action("Exit", slot=exit_app) + action_sys_info = self.create_action(self.tr("System Info"), icon="dom0") + action_exit = self.create_action(self.tr("Exit"), slot=exit_app) action_backup.setDisabled(True) action_preferences.setDisabled(True) @@ -1793,8 +1801,8 @@ class QubesTrayIcon(QSystemTrayIcon): self.blk_manager = blk_manager self.blk_menu = QMenu(self.menu) - self.blk_menu.setTitle("Block devices") - action_blk_menu = self.create_action("Block devices") + self.blk_menu.setTitle(self.tr("Block devices")) + action_blk_menu = self.create_action(self.tr("Block devices")) action_blk_menu.setMenu(self.blk_menu) self.add_actions(self.menu, (action_showmanager, @@ -1825,7 +1833,7 @@ class QubesTrayIcon(QSystemTrayIcon): self.tray_notifier_type = srv_info.arguments()[1] if os.path.exists(table_widgets.qubes_dom0_updates_stat_file): - self.showMessage("Qubes dom0 updates available.", msecs=0) + self.showMessage(self.tr("Qubes dom0 updates available."), msecs=0) def update_blk_menu(self): global manager_window @@ -1854,11 +1862,11 @@ class QubesTrayIcon(QSystemTrayIcon): if len(self.blk_manager.attached_devs) > 0: for d in self.blk_manager.attached_devs: vm = self.blk_manager.attached_devs[d]['attached_to']['vm'] - text = "Detach %s %s (%s) from %s" % ( - d, - self.blk_manager.attached_devs[d]['desc'], - unicode(self.blk_manager.attached_devs[d]['size']), - vm.name) + text = self.tr("Detach {dev} {desc} ({size}) from {vm}").format( + dev=d, + desc=self.blk_manager.attached_devs[d]['desc'], + size=unicode(self.blk_manager.attached_devs[d]['size']), + vm=vm.name) action = self.blk_menu.addAction(QIcon(":/remove.png"), text) action.setData(QVariant(d)) action.triggered.connect( @@ -1869,10 +1877,10 @@ class QubesTrayIcon(QSystemTrayIcon): # skip partitions heuristic if d[-1].isdigit() and d[0:-1] in self.blk_manager.current_blk: continue - text = "Attach %s %s %s" % ( - d, - unicode(self.blk_manager.free_devs[d]['size']), - self.blk_manager.free_devs[d]['desc'] + text = self.tr("Attach {dev} {size} {desc}").format( + dev=d, + size=unicode(self.blk_manager.free_devs[d]['size']), + desc=self.blk_manager.free_devs[d]['desc'] ) action = self.blk_menu.addAction(QIcon(":/add.png"), text) action.setMenu(create_vm_submenu(d)) @@ -1892,7 +1900,8 @@ class QubesTrayIcon(QSystemTrayIcon): self.blk_manager.blk_lock.release() except QubesException as e: self.blk_manager.blk_lock.release() - QMessageBox.critical(None, "Block attach/detach error!", str(e)) + QMessageBox.critical(None, + self.tr("Block attach/detach error!"), str(e)) @pyqtSlot('QAction *') def dettach_device_triggered(self, action): @@ -1905,7 +1914,8 @@ class QubesTrayIcon(QSystemTrayIcon): self.blk_manager.blk_lock.release() except QubesException as e: self.blk_manager.blk_lock.release() - QMessageBox.critical(None, "Block attach/detach error!", str(e)) + QMessageBox.critical(None, + self.tr("Block attach/detach error!"), str(e)) def icon_clicked(self, reason): if reason == QSystemTrayIcon.Context: diff --git a/qubesmanager/restore.py b/qubesmanager/restore.py index fa34933..d1429e6 100644 --- a/qubesmanager/restore.py +++ b/qubesmanager/restore.py @@ -145,7 +145,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard): continue self.select_vms_widget.available_list.addItem(vmname) except QubesException as ex: - QMessageBox.warning (None, "Restore error!", str(ex)) + QMessageBox.warning (None, self.tr("Restore error!"), str(ex)) def __init_restore_options__(self): if not self.restore_options: @@ -192,24 +192,25 @@ class RestoreVMsWindow(Ui_Restore, QWizard): except Exception as ex: print "Exception:", ex err_msg.append(unicode(ex)) - err_msg.append("Partially restored files left in " - "/var/tmp/restore_*, investigate them and/or clean them up") + err_msg.append( + self.tr("Partially restored files left in " + "/var/tmp/restore_*, investigate them and/or clean them up")) self.qvm_collection.unlock_db() if self.canceled: self.emit(SIGNAL("restore_progress(QString)"), '{0}' - .format("Restore aborted!")) + .format(self.tr("Restore aborted!"))) elif len(err_msg) > 0 or self.error_detected.is_set(): if len(err_msg) > 0: thread_monitor.set_error_msg('\n'.join(err_msg)) self.emit(SIGNAL("restore_progress(QString)"), '{0}' - .format("Finished with errors!")) + .format(self.tr("Finished with errors!"))) else: self.emit(SIGNAL("restore_progress(QString)"), '{0}' - .format("Finished successfully!")) + .format(self.tr("Finished successfully!"))) thread_monitor.set_finished() @@ -263,30 +264,31 @@ class RestoreVMsWindow(Ui_Restore, QWizard): if not self.thread_monitor.success: if self.canceled: if self.tmpdir_to_remove and \ - QMessageBox.warning(None, "Restore aborted", - "Do you want to remove temporary " - "files from %s?" % self - .tmpdir_to_remove, - QMessageBox.Yes, QMessageBox.No) == \ + QMessageBox.warning(None, self.tr("Restore aborted"), + 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: - QMessageBox.warning (None, "Backup error!", "ERROR: {1}" - .format(self.vm.name, self.thread_monitor.error_msg)) + QMessageBox.warning(None, + self.tr("Backup error!"), self.tr("ERROR: {0}") + .format(self.thread_monitor.error_msg)) if self.showFileDialog.isChecked(): self.emit(SIGNAL("restore_progress(QString)"), '{0}'.format( - "Please unmount your backup volume and cancel " - "the file selection dialog.")) + self.tr( + "Please unmount your backup volume and cancel" + " the file selection dialog."))) if self.target_appvm: - self.target_appvm.run("QUBESRPC %s dom0" % "qubes" - ".SelectDirectory") + self.target_appvm.run("QUBESRPC %s dom0" % + "qubes.SelectDirectory") else: file_dialog = QFileDialog() file_dialog.setReadOnly(True) file_dialog.getExistingDirectory( - self, "Detach backup device", + self, self.tr("Detach backup device"), os.path.dirname(unicode(self.dir_line_edit.text()))) self.progress_bar.setValue(100) self.button(self.FinishButton).setEnabled(True) @@ -308,7 +310,7 @@ class RestoreVMsWindow(Ui_Restore, QWizard): if backup.backup_cancel(): self.emit(SIGNAL("restore_progress(QString)"), '{0}' - .format("Aborting the operation...")) + .format(self.tr("Aborting the operation..."))) self.button(self.CancelButton).setDisabled(True) else: self.done(0) diff --git a/qubesmanager/settings.py b/qubesmanager/settings.py index 09e7b02..b507984 100755 --- a/qubesmanager/settings.py +++ b/qubesmanager/settings.py @@ -54,7 +54,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): self.source_vm = self.vm self.setupUi(self) - self.setWindowTitle("Settings: %s" % self.vm.name) + self.setWindowTitle(self.tr("Settings: {vm}").format(vm=self.vm.name)) if init_page in self.tabs_indices: idx = self.tabs_indices[init_page] assert (idx in range(self.tabWidget.count())) @@ -118,7 +118,8 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): thread.daemon = True thread.start() - progress = QProgressDialog ("Applying settings to {0}...".format(self.vm.name), "", 0, 0) + progress = QProgressDialog( + self.tr("Applying settings to {0}...").format(self.vm.name), "", 0, 0) progress.setCancelButton(None) progress.setModal(True) progress.show() @@ -130,8 +131,9 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): progress.hide() if not thread_monitor.success: - QMessageBox.warning (None, "Error while changing settings for {0}!".format(self.vm.name), - "ERROR: {0}".format(thread_monitor.error_msg)) + QMessageBox.warning(None, + self.tr("Error while changing settings for {0}!").format(self.vm.name), + self.tr("ERROR: {0}").format(thread_monitor.error_msg)) self.done(0) @@ -155,7 +157,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): if len(ret_tmp) > 0: ret += ["Sevices tab:"] + ret_tmp except Exception as ex: - ret.append('Error while saving changes: ' + str(ex)) + ret.append(self.tr('Error while saving changes: ') + str(ex)) if self.anything_changed == True: self.qvm_collection.save() @@ -170,13 +172,13 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): self.tempFullAccess.isChecked(), self.tempFullAccessTime.value()) except Exception as ex: - ret += ["Firewall tab:", str(ex)] + ret += [self.tr("Firewall tab:"), str(ex)] try: if self.tabWidget.isTabEnabled(self.tabs_indices["applications"]): self.AppListManager.save_appmenu_select_changes() except Exception as ex: - ret += ["Applications tab:", str(ex)] + ret += [self.tr("Applications tab:"), str(ex)] if len(ret) > 0 : thread_monitor.set_error_msg('\n'.join(ret)) @@ -187,8 +189,13 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): def current_tab_changed(self, idx): if idx == self.tabs_indices["firewall"]: if self.vm.netvm is not None and not self.vm.netvm.is_proxyvm(): - QMessageBox.warning (None, "VM configuration problem!", "The '{0}' AppVM is not network connected to a FirewallVM!

".format(self.vm.name) +\ - "You may edit the '{0}' VM firewall rules, but these will not take any effect until you connect it to a working Firewall VM.".format(self.vm.name)) + QMessageBox.warning(None, + self.tr("VM configuration problem!"), + self.tr("The '{vm}' AppVM is not network connected to a " + "FirewallVM!

" + "You may edit the '{vm}' VM firewall rules, but these " + "will not take any effect until you connect it to " + "a working Firewall VM.").format(vm=self.vm.name)) @@ -228,10 +235,10 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): continue text = vm.name if vm is self.qvm_collection.get_default_template(): - text += " (default)" + text += self.tr(" (default)") if vm.qid == self.vm.template.qid: self.template_idx = i - text += " (current)" + text += self.tr(" (current)") self.template_name.insertItem(i, text) i += 1 self.template_name.setCurrentIndex(self.template_idx) @@ -249,7 +256,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): if default_netvm is not None: text = "default (%s)" % default_netvm.name if self.vm.uses_default_netvm: - text += " (current)" + text += self.tr(" (current)") self.netvm_idx = 0 self.netVM.insertItem(0, text) @@ -257,12 +264,12 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): text = vm.name if self.vm.netvm is not None and vm.qid == self.vm.netvm.qid and not self.vm.uses_default_netvm: self.netvm_idx = i+1 - text += " (current)" + text += self.tr(" (current)") self.netVM.insertItem(i+1, text) none_text = "none" if self.vm.netvm is None: - none_text += " (current)" + none_text += self.tr(" (current)") self.netvm_idx = len(netvm_list)+1 self.netVM.insertItem(len(netvm_list)+1, none_text) @@ -326,9 +333,11 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): vmname = str(self.vmname.text()) if self.vm.name != vmname: if self.vm.is_running(): - msg.append("Can't change name of a running VM.") + msg.append(self.tr("Can't change name of a running VM.")) elif self.qvm_collection.get_vm_by_name(vmname) is not None: - msg.append("Can't change VM name - a VM named {0} already exists in the system!".format(vmname)) + msg.append( + self.tr("Can't change VM name - a VM named {0}" + "already exists in the system!").format(vmname)) else: oldname = self.vm.name try: @@ -442,11 +451,18 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): def check_mem_changes(self): if self.max_mem_size.value() < self.init_mem.value(): - QMessageBox.warning(None, "Warning!", "Max memory can not be less than initial memory.
Setting max memory to equal initial memory.") + QMessageBox.warning(None, + self.tr("Warning!"), + self.tr("Max memory can not be less than initial memory.
" + "Setting max memory to equal initial memory.")) self.max_mem_size.setValue(self.init_mem.value()) # Linux specific limit: init memory must not be below max_mem_size/10.79 in order to allow scaling up to max_mem_size (or else "add_memory() failed: -17" problem) if self.init_mem.value() * 10 < self.max_mem_size.value(): - QMessageBox.warning(None, "Warning!", "Initial memory can not be less than one tenth Max memory.
Setting initial memory to the minimum allowed value.") + QMessageBox.warning(None, + self.tr("Warning!"), + self.tr("Initial memory can not be less than one tenth " + "Max memory.
Setting initial memory to the minimum " + "allowed value.")) self.init_mem.setValue(self.max_mem_size.value() / 10) @@ -563,7 +579,7 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): text = "default (same as VM own NetVM)" if self.vm.uses_default_dispvm_netvm: - text += " (current)" + text += self.tr(" (current)") self.dispvm_netvm_idx = 0 self.dispvm_netvm.insertItem(0, text) @@ -573,12 +589,12 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): self.vm.dispvm_netvm.qid and not \ self.vm.uses_default_dispvm_netvm: self.dispvm_netvm_idx = i+1 - text += " (current)" + text += self.tr(" (current)") self.dispvm_netvm.insertItem(i+1, text) none_text = "none" if self.vm.dispvm_netvm is None: - none_text += " (current)" + none_text += self.tr(" (current)") self.dispvm_netvm_idx = len(netvm_list)+1 self.dispvm_netvm.insertItem(len(netvm_list)+1, none_text) @@ -804,7 +820,8 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): srv = str(self.service_line_edit.text()).strip() if srv != "": if srv in self.new_srv_dict: - QMessageBox.information(None, "", "Service already on the list!") + QMessageBox.information(None, "", + self.tr("Service already on the list!")) else: item = QListWidgetItem(srv) item.setCheckState(QtCore.Qt.Checked) @@ -817,7 +834,9 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): if not item: return if str(item.text()) == 'meminfo-writer': - QMessageBox.information(None, "Service can not be removed", "Service meminfo-writer can not be removed from the list.") + QMessageBox.information(None, + self.tr("Service can not be removed"), + self.tr("Service meminfo-writer can not be removed from the list.")) return row = self.services_list.currentRow() @@ -958,8 +977,9 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): if port is not None: if port2 is not None and port2 <= port: - QMessageBox.warning(None, "Invalid service ports range", - "Port {0} is lower than port {1}.".format(port2, port)) + QMessageBox.warning(None, self.tr("Invalid service ports range"), + self.tr("Port {0} is lower than port {1}.").format( + port2, port)) else: item = {"address": address, "netmask": netmask, @@ -972,8 +992,8 @@ class VMSettingsWindow(Ui_SettingsDialog, QDialog): else: self.fw_model.appendChild(item) else: - QMessageBox.warning(None, "Invalid service name", - "Service '{0}' is unknown.".format(service)) + QMessageBox.warning(None, self.tr("Invalid service name"), + self.tr("Service '{0}' is unknown.").format(service)) # Bases on the original code by: diff --git a/qubesmanager/table_widgets.py b/qubesmanager/table_widgets.py index 2b5441c..0a5790f 100644 --- a/qubesmanager/table_widgets.py +++ b/qubesmanager/table_widgets.py @@ -605,16 +605,20 @@ class VmUpdateInfoWidget(QWidget): if state == "update": label_text = "Check updates" icon_path = ":/update-recommended.png" - tooltip_text = "Updates pending!" + tooltip_text = self.tr("Updates pending!") elif state == "outdated": label_text = "VM outdated" icon_path = ":/outdated.png" - tooltip_text = "The VM must be restarted for its filesystem to reflect the template's recent committed changes." + tooltip_text = self.tr( + "The VM must be restarted for its filesystem to reflect the " + "template's recent committed changes.") elif state == "to-be-outdated": label_text = "TemplateVM running" icon_path = ":/to-be-outdated.png" - tooltip_text = "The TemplateVM must be stopped before changes from its current session can be picked up by this VM." - elif state == None: + tooltip_text = self.tr( + "The TemplateVM must be stopped before changes from its " + "current session can be picked up by this VM.") + elif state is None: label_text = "" icon_path = None tooltip_text = None @@ -624,7 +628,7 @@ class VmUpdateInfoWidget(QWidget): else: self.layout().removeWidget(self.icon) self.icon.deleteLater() - if icon_path != None: + if icon_path is not None: self.icon = VmIconWidget(icon_path, True, 0.7) self.icon.setToolTip(tooltip_text) else: From 519cacc5ce44ba7a0a553251498a7ff0b77fb8ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Sun, 22 Jan 2017 05:45:34 +0100 Subject: [PATCH 3/7] i18n: add skeleton translation file for spanish QubesOS/qubes-issues#2599 --- i18n/qubesmanager_es.ts | 2008 +++++++++++++++++++++++++++++++++++++++ qubesmanager.pro | 2 +- 2 files changed, 2009 insertions(+), 1 deletion(-) create mode 100644 i18n/qubesmanager_es.ts diff --git a/i18n/qubesmanager_es.ts b/i18n/qubesmanager_es.ts new file mode 100644 index 0000000..6a71aad --- /dev/null +++ b/i18n/qubesmanager_es.ts @@ -0,0 +1,2008 @@ + + + + AboutDialog + + + About + + + + + Qubes OS + + + + + Qubes OS release + + + + + Release notes + + + + + OK + + + + + Backup + + + Qubes Backup VMs + + + + + Shutdown all running selected VMs + + + + + Refresh running states. + + + + + Some of the selected VMs are running (red). Running VMs cannot be backed up! + + + + + Select VMs to backup: + + + + + Total size: + + + + + 0 + + + + + Backup destination directory + + + + + ... + + + + + Target AppVM: + + + + + Backup directory or VM command: + + + + + Backup security + + + + + <html><head/><body><p>Encryption / Verification<br/>passphrase:</p></body></html> + + + + + Encrypt backup: + + + + + <html><head/><body><p>Reenter passphrase:</p></body></html> + + + + + You're about to perform the following actions: + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> + + + + + To continue press Next. + + + + + Backup in progress... + + + + + When finished, open file selection dialog to allow me to unmount the disk + + + + + BackupVMsWindow + + + Backup in progress... + + + + + DevListWidgetItem + + + Service already on the list! + + + + + Service can not be removed + + + + + Service meminfo-writer can not be removed from the list. + + + + + Invalid service ports range + + + + + Port {0} is lower than port {1}. + + + + + Invalid service name + + + + + Service '{0}' is unknown. + + + + + GlobalSettings + + + Qubes Global Settings + + + + + System defaults + + + + + UpdateVM: + + + + + ClockVM: + + + + + Default netVM: + + + + + Default template: + + + + + Default memory settings + + + + + Minimal VM's memory: + + + + + MiB + + + + + dom0 memory boost: + + + + + Keep dispVM in memory + + + + + Kernel + + + + + Default kernel: + + + + + Updates + + + + + Check for dom0 updates + + + + + Unknown current state + + + + + Check for VM updates + + + + + GlobalSettingsWindow + + + (current) + + + + + LogDialog + + + (Showing only last %d bytes of file) + + + + + + Dialog + + + + + Copy Dom0 clipboard to Qubes clipboard + + + + + Copy to Qubes clipboard + + + + + MultiSelectWidget + + + Form + + + + + Available + + + + + >> + + + + + > + + + + + < + + + + + << + + + + + Selected + + + + + NewFwRuleDlg + + + Firewall rule + + + + + You need to fill service name/port for TCP/UDP rule + + + + + New Address + + + + + Protocol + + + + + Service + + + + + Address + + + + + TCP + + + + + UDP + + + + + Any + + + + + NewVMDlg + + + Create New VM + + + + + <html><head/><body><p><span style=" font-weight:600; color:#ff0000;">Make sure that the license of the OS installed in a template VM grants you permission to run multiple instances of an installed system.</span></p></body></html> + + + + + Name and label: + + + + + my-new-vm + + + + + Use this template: + + + + + Standalone + + + + + AppVM + + + + + NetVM + + + + + ProxyVM + + + + + HVM + + + + + HVM template + + + + + Allow networking: + + + + + NewVmDlg + + + (default) + + + + + Incorrect AppVM Name! + + + + + A VM with the name <b>{0}</b> already exists in the system! + + + + + No template available! + + + + + Cannot create non-standalone VM when no compatible template exists. Create template VM first or choose to create standalone VM. + + + + + Error creating AppVM! + + + + + Unknown VM type, this is error in Qubes Manager + + + + + Creating new {0} <b>{1}</b>... + + + + + ERROR: {0} + + + + + QubesManagerFileWatcher + + + Qubes Clipboard has been copied to the VM and wiped.<i/> +<small>Trigger a paste operation (e.g. Ctrl-v) to insert it into an application.</small> + + + + + Qubes Clipboard fetched from VM: <b>'{0}'</b> +<small>Press Ctrl-Shift-v to copy this clipboard into dest VM's clipboard.</small> + + + + + Qubes dom0 updates available. + + + + + QubesTrayIcon + + + Open VM Manager + + + + + Copy Dom0 clipboard + + + + + Make backup + + + + + Preferences + + + + + Set default NetVM + + + + + System Info + + + + + Exit + + + + + Block devices + + + + + Qubes dom0 updates available. + + + + + Detach {dev} {desc} ({size}) from {vm} + + + + + Attach {dev} {size} {desc} + + + + + Block attach/detach error! + + + + + ReleaseNotesDialog + + + Qubes Release Notes + + + + + Restore + + + Qubes Restore VMs + + + + + Restore options + + + + + Ignore missing templates or netvms, restore VMs anyway. + + + + + ignore missing + + + + + Ignore dom0 username mismatch while restoring homedir. + + + + + ignore username mismatch + + + + + Verify backup integrity, do not restore the data + + + + + Backup source location + + + + + ... + + + + + <html><head/><body><p>Backup file:<br><span style=" font-size:8pt;">(for old backup format select qubes.xml file)</span></p></body></html> + + + + + AppVM: + + + + + Security options + + + + + Encrypted backup: + + + + + <html><head/><body><p>Decryption / Verification<br/>passphrase:</p></body></html> + + + + + VMs to restore + + + + + You're about to perform the following actions: + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;"><br /></p></body></html> + + + + + To continue press Next. + + + + + When finished, open file selection dialog to allow me to unmount the disk + + + + + RestoreVMsWindow + + + Restore error! + + + + + Partially restored files left in /var/tmp/restore_*, investigate them and/or clean them up + + + + + Restore aborted! + + + + + Finished with errors! + + + + + Finished successfully! + + + + + Restore aborted + + + + + Do you want to remove temporary files from %s? + + + + + Backup error! + + + + + ERROR: {0} + + + + + Please unmount your backup volume and cancel the file selection dialog. + + + + + Detach backup device + + + + + Aborting the operation... + + + + + SettingsDialog + + + Settings + + + + + <html><head/><body><p>Name &amp;&amp; label<span style=" color:#ff0000;">*</span>:</p></body></html> + + + + + ---- + + + + + <html><head/><body><p>Template<span style=" color:#ff0000;">*</span>:</p></body></html> + + + + + NetVM: + + + + + Include in backups by default + + + + + Run in debug mode + + + + + Start VM automatically on boot + + + + + Seamless GUI + + + + + General + + + + + Type: + + + + + --- + + + + + Installed by RPM: + + + + + Disk storage + + + + + MB + + + + + Private storage max. size: + + + + + System storage max. size: + + + + + Networking + + + + + IP: + + + + + Netmask: + + + + + Gateway: + + + + + <html><head/><body><p><span style=" color:#ff0000;">* </span><span style=" color:#000000;">Cannot be changed while the VM is running</span></p></body></html> + + + + + Basic + + + + + Memory/CPU + + + + + Initial memory: + + + + + Max memory: + + + + + VCPUs no.: + + + + + Include in memory balancing + + + + + Dynamic memory balancing can result in some devices not working! + + + + + Paths + + + + + dir: + + + + + dir_path + + + + + config: + + + + + config_path + + + + + root img: + + + + + root_img_path + + + + + root volatile img: + + + + + volatile_path + + + + + private img: + + + + + private_path + + + + + Other + + + + + NetVM for DispVM: + + + + + Kernel + + + + + Kernel: + + + + + Kernel opts: + + + + + [] + + + + + Additional drive + + + + + Path: + + + + + Backend domain: + + + + + ... + + + + + New drive will be used only at next VM startup + + + + + Advanced + + + + + Allow network access except... + + + + + Allow ICMP traffic + + + + + Deny network access except... + + + + + Allow DNS queries + + + + + Allow connections to Updates Proxy + + + + + Allow full access for + + + + + min + + + + + Firewall rules + + + + + You've enabled dynamic memory balancing, some devices might not work! + + + + + To modify PCI devices you have to turn off the VM. + + + + + Devices + + + + + Applications + + + + + Checked services will be turned on. + + + + + Unchecked services will be turned off. + + + + + Unlisted services will follow default settings. + + + + + Services + + + + + VMSettingsWindow + + + Settings: {vm} + + + + + Applying settings to <b>{0}</b>... + + + + + Error while changing settings for {0}! + + + + + ERROR: {0} + + + + + Error while saving changes: + + + + + Firewall tab: + + + + + Applications tab: + + + + + VM configuration problem! + + + + + The '{vm}' AppVM is not network connected to a FirewallVM!<p>You may edit the '{vm}' VM firewall rules, but these will not take any effect until you connect it to a working Firewall VM. + + + + + (default) + + + + + (current) + + + + + Can't change name of a running VM. + + + + + Can't change VM name - a VM named <b>{0}</b>already exists in the system! + + + + + Warning! + + + + + Max memory can not be less than initial memory.<br>Setting max memory to equal initial memory. + + + + + Initial memory can not be less than one tenth Max memory.<br>Setting initial memory to the minimum allowed value. + + + + + VmListItem + + + VM Shutdown Confirmation + + + + + Are you sure you want to power down the following VMs: <b>{0}</b>?<br/><small>This will shutdown all the running applications within them.</small> + + + + + Wait! + + + + + Some selected VMs are running. Running VMs can not be backuped. Please shut them down or remove them from the list. + + + + + Enter backup target location first. + + + + + Selected directory do not exists or not a directory (%s). + + + + + Enter passphrase for backup encryption/verification first. + + + + + Enter the same passphrase in both fields. + + + + + Error while preparing backup. + + + + + ERROR: {0} + + + + + Backup aborted. + + + + + Backup aborted + + + + + Do you want to remove temporary files from %s? + + + + + Backup error. + + + + + Backup error! + + + + + ERROR: {} + + + + + Backup finished. + + + + + Please unmount your backup volume and cancel the file selection dialog. + + + + + VmManagerWindow + + + Warning! + + + + + This Template VM cannot be removed, because there is at least one AppVM that is based on it.<br><small>If you want to remove this Template VM and all the AppVMs based on it,you should first remove each individual AppVM that uses this template.</small> + + + + + VM Removal Confirmation + + + + + Are you sure you want to remove the VM <b>'{0}'</b>?<br>All data on this VM's private storage will be lost!<br><br>Type the name of the VM (<b>{1}</b>) below to confirm: + + + + + VM removal confirmation failed + + + + + Entered name did not match! Not removing {0}. + + + + + Removing VM: <b>{0}</b>... + + + + + VM '{0}' has been removed. + + + + + Error removing VM! + + + + + ERROR: {0} + + + + + Qubes clone VM + + + + + Enter name for VM <b>{}</b> clone: + + + + + Cloning VM <b>{0}</b> to <b>{1}</b>... + + + + + Error while cloning VM + + + + + Exception while cloning:<br>{0} + + + + + Error unpausing VM! + + + + + Starting '{0}'... + + + + + VM '{0}' has been started. + + + + + Error starting VM <b>'{0}'</b>: {1} + + + + + Error starting VM: %s + + + + + Error starting VM! + + + + + You need to install 'qubes-windows-tools' package to use this option + + + + + VM '{0}' has been started. Start Qubes Tools installation from attached CD + + + + + Error pausing VM! + + + + + VM Shutdown Confirmation + + + + + Are you sure you want to power down the VM <b>'{0}'</b>?<br><small>This will shutdown all the running applications within this VM.</small> + + + + + Error shutting down VM! + + + + + VM '{0}' is shutting down... + + + + + VM Restart Confirmation + + + + + Are you sure you want to restart the VM <b>'{0}'</b>?<br><small>This will shutdown all the running applications within this VM.</small> + + + + + VM Kill Confirmation + + + + + Are you sure you want to kill the VM <b>'{0}'</b>?<br><small>This will end <b>(not shutdown!)</b> all the running applications within this VM.</small> + + + + + Error while killing VM! + + + + + <b>An exception ocurred while killing {0}.</b><br>ERROR: {1} + + + + + VM Update Confirmation + + + + + <b>{0}</b><br>The VM has to be running to be updated.<br>Do you want to start it?<br> + + + + + <b>{0}</b><br>Please wait for the updater to launch... + + + + + Error VM update! + + + + + Qubes command entry + + + + + Run command in <b>{}</b>: + + + + + Error while running command + + + + + Exception while running command:<br>{0} + + + + + Detach {dev} {size} {desc} + + + + + Attach {dev} {size} {desc} + + + + + Block attach/detach error! + + + + + Qubes VM Manager + + + + + Search: + + + + + Nowy wiersz + + + + + Name + + + + + VM name + + + + + State + + + + + Update info + + + + + Template + + + + + VM's template + + + + + NetVM + + + + + VM's netVM + + + + + CPU + + + + + CPU Graph + + + + + CPU usage graph + + + + + MEM + + + + + MEM Graph + + + + + Memory usage graph + + + + + Size + + + + + Internal + + + + + IP + + + + + Backups + + + + + Last backup + + + + + &System + + + + + &View + + + + + V&M + + + + + &Logs + + + + + Attach/detach &block devices + + + + + &About + + + + + toolBar + + + + + Create &New VM + + + + + Create a new VM + + + + + &Delete VM + + + + + Remove an existing VM (must be stopped first) + + + + + Start/Resume V&M + + + + + Start/Resume selected VM + + + + + &Pause VM + + + + + Pause selected VM + + + + + &Shutdown VM + + + + + Shutdown selected VM + + + + + Restar&t VM + + + + + Restart selected VM + + + + + Add/remove app s&hortcuts + + + + + Add/remove app shortcuts for this VM + + + + + &Update VM + + + + + Update VM system + + + + + Attach/detach &audio-input to the VM + + + + + Attach/detach audio-input to the VM + + + + + Show/Hide inactive VMs + + + + + Edit VM &firewall rules + + + + + Edit VM firewall rules + + + + + Show graphs + + + + + Show Graphs + + + + + Options + + + + + View + + + + + &CPU + + + + + CPU &Graph + + + + + &MEM + + + + + M&EM Graph + + + + + &Template + + + + + &NetVM + + + + + VM s&ettings + + + + + VM Settings + + + + + &Restore VMs from backup + + + + + &Backup VMs + + + + + &Global settings + + + + + &State + + + + + &Kill VM + + + + + Kill selected VM + + + + + Set keyboard la&yout + + + + + Set keyboard layout per VM + + + + + T&ype + + + + + VM Type + + + + + &Label + + + + + N&ame + + + + + Show tool bar + + + + + Show menu bar + + + + + &Qubes OS + + + + + Si&ze + + + + + Size on Disk + + + + + &Run command in VM + + + + + Run command in the specified VM + + + + + &Clone VM + + + + + Inte&rnal + + + + + Is an internal VM + + + + + Show/Hide internal VMs + + + + + Start VM for Window Tools installation + + + + + &IP + + + + + Include in &backups + + + + + Last back&up + + + + + Search + + + + + Ctrl+F + + + + + VmShutdownMonitor + + + VM Shutdown + + + + + The VM <b>'{0}'</b> hasn't shutdown within the last {1} seconds, do you want to kill it?<br> + + + + + Kill it! + + + + + Wait another {0} seconds... + + + + + VmUpdateInfoItem + + + Updates pending! + + + + + The VM must be restarted for its filesystem to reflect the template's recent committed changes. + + + + + The TemplateVM must be stopped before changes from its current session can be picked up by this VM. + + + + + dialog + + + Select backup location. + + + + diff --git a/qubesmanager.pro b/qubesmanager.pro index f0d826f..e6172f4 100644 --- a/qubesmanager.pro +++ b/qubesmanager.pro @@ -40,7 +40,7 @@ SOURCES = \ qubesmanager/ui_restoredlg.py \ qubesmanager/ui_settingsdlg.py -TRANSLATIONS = +TRANSLATIONS = i18n/qubesmanager_es.ts CODECFORTR = UTF-8 From f1f9523bd2a5dc86c259530f7c1c934aea3d7627 Mon Sep 17 00:00:00 2001 From: Pablo Di Noto Date: Fri, 3 Feb 2017 00:57:18 -0300 Subject: [PATCH 4/7] Translated some strings to test the process "About" dialog and most of "VM Backup" wizard translated (missing a couple of HTML-embedded strings I am in doubt if valid Ref: https://github.com/QubesOS/qubes-issues/issues/2599#issuecomment-277070503 --- i18n/qubesmanager_es.ts | 46 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/i18n/qubesmanager_es.ts b/i18n/qubesmanager_es.ts index 6a71aad..78bab07 100644 --- a/i18n/qubesmanager_es.ts +++ b/i18n/qubesmanager_es.ts @@ -5,27 +5,27 @@ About - + Acerca de... Qubes OS - + Qubes OS Qubes OS release - + Versión de Qubes OS Release notes - + Notas de esta versión OK - + Ok @@ -33,62 +33,62 @@ Qubes Backup VMs - + Qubes - Respaldo de VMs Shutdown all running selected VMs - + Apagar todas las VMs seleccionadas en funcionamiento Refresh running states. - + Refrescar el estado de funcionamiento Some of the selected VMs are running (red). Running VMs cannot be backed up! - + Algunas de las VMs seleccionadas estan funcionando (en rojo). Una VM en funcionamiento no puede ser respaldada. Select VMs to backup: - + Selecciones VMs a respaldar Total size: - + Tamaño total: 0 - + 0 Backup destination directory - + Directorio de destino para los respaldos ... - + ... Target AppVM: - + AppVM de destino: Backup directory or VM command: - + Directorio o comando en la VM: Backup security - + Seguridad del respaldo @@ -98,7 +98,7 @@ Encrypt backup: - + Cifrar el respaldo: @@ -108,7 +108,7 @@ You're about to perform the following actions: - + Se van a realizar las siguientes operaciones: @@ -122,17 +122,17 @@ p, li { white-space: pre-wrap; } To continue press Next. - + Para continuar oprima Siguiente. Backup in progress... - + Respaldo en proceso... When finished, open file selection dialog to allow me to unmount the disk - + Al terminar, abrir el diálogo de selección de archivos para permitir desmontar la unidad @@ -140,7 +140,7 @@ p, li { white-space: pre-wrap; } Backup in progress... - + Respaldo en proceso... From 08e32afdb2d5b80786ad8f8fda1c914725b70f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 3 Feb 2017 17:21:12 +0100 Subject: [PATCH 5/7] i18n: add 'en' translation file as a source template QubesOS/qubes-issues#2599 --- i18n/qubesmanager_en.ts | 2008 +++++++++++++++++++++++++++++++++++++++ qubesmanager.pro | 4 +- 2 files changed, 2011 insertions(+), 1 deletion(-) create mode 100644 i18n/qubesmanager_en.ts diff --git a/i18n/qubesmanager_en.ts b/i18n/qubesmanager_en.ts new file mode 100644 index 0000000..6a71aad --- /dev/null +++ b/i18n/qubesmanager_en.ts @@ -0,0 +1,2008 @@ + + + + AboutDialog + + + About + + + + + Qubes OS + + + + + Qubes OS release + + + + + Release notes + + + + + OK + + + + + Backup + + + Qubes Backup VMs + + + + + Shutdown all running selected VMs + + + + + Refresh running states. + + + + + Some of the selected VMs are running (red). Running VMs cannot be backed up! + + + + + Select VMs to backup: + + + + + Total size: + + + + + 0 + + + + + Backup destination directory + + + + + ... + + + + + Target AppVM: + + + + + Backup directory or VM command: + + + + + Backup security + + + + + <html><head/><body><p>Encryption / Verification<br/>passphrase:</p></body></html> + + + + + Encrypt backup: + + + + + <html><head/><body><p>Reenter passphrase:</p></body></html> + + + + + You're about to perform the following actions: + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><br /></p></body></html> + + + + + To continue press Next. + + + + + Backup in progress... + + + + + When finished, open file selection dialog to allow me to unmount the disk + + + + + BackupVMsWindow + + + Backup in progress... + + + + + DevListWidgetItem + + + Service already on the list! + + + + + Service can not be removed + + + + + Service meminfo-writer can not be removed from the list. + + + + + Invalid service ports range + + + + + Port {0} is lower than port {1}. + + + + + Invalid service name + + + + + Service '{0}' is unknown. + + + + + GlobalSettings + + + Qubes Global Settings + + + + + System defaults + + + + + UpdateVM: + + + + + ClockVM: + + + + + Default netVM: + + + + + Default template: + + + + + Default memory settings + + + + + Minimal VM's memory: + + + + + MiB + + + + + dom0 memory boost: + + + + + Keep dispVM in memory + + + + + Kernel + + + + + Default kernel: + + + + + Updates + + + + + Check for dom0 updates + + + + + Unknown current state + + + + + Check for VM updates + + + + + GlobalSettingsWindow + + + (current) + + + + + LogDialog + + + (Showing only last %d bytes of file) + + + + + + Dialog + + + + + Copy Dom0 clipboard to Qubes clipboard + + + + + Copy to Qubes clipboard + + + + + MultiSelectWidget + + + Form + + + + + Available + + + + + >> + + + + + > + + + + + < + + + + + << + + + + + Selected + + + + + NewFwRuleDlg + + + Firewall rule + + + + + You need to fill service name/port for TCP/UDP rule + + + + + New Address + + + + + Protocol + + + + + Service + + + + + Address + + + + + TCP + + + + + UDP + + + + + Any + + + + + NewVMDlg + + + Create New VM + + + + + <html><head/><body><p><span style=" font-weight:600; color:#ff0000;">Make sure that the license of the OS installed in a template VM grants you permission to run multiple instances of an installed system.</span></p></body></html> + + + + + Name and label: + + + + + my-new-vm + + + + + Use this template: + + + + + Standalone + + + + + AppVM + + + + + NetVM + + + + + ProxyVM + + + + + HVM + + + + + HVM template + + + + + Allow networking: + + + + + NewVmDlg + + + (default) + + + + + Incorrect AppVM Name! + + + + + A VM with the name <b>{0}</b> already exists in the system! + + + + + No template available! + + + + + Cannot create non-standalone VM when no compatible template exists. Create template VM first or choose to create standalone VM. + + + + + Error creating AppVM! + + + + + Unknown VM type, this is error in Qubes Manager + + + + + Creating new {0} <b>{1}</b>... + + + + + ERROR: {0} + + + + + QubesManagerFileWatcher + + + Qubes Clipboard has been copied to the VM and wiped.<i/> +<small>Trigger a paste operation (e.g. Ctrl-v) to insert it into an application.</small> + + + + + Qubes Clipboard fetched from VM: <b>'{0}'</b> +<small>Press Ctrl-Shift-v to copy this clipboard into dest VM's clipboard.</small> + + + + + Qubes dom0 updates available. + + + + + QubesTrayIcon + + + Open VM Manager + + + + + Copy Dom0 clipboard + + + + + Make backup + + + + + Preferences + + + + + Set default NetVM + + + + + System Info + + + + + Exit + + + + + Block devices + + + + + Qubes dom0 updates available. + + + + + Detach {dev} {desc} ({size}) from {vm} + + + + + Attach {dev} {size} {desc} + + + + + Block attach/detach error! + + + + + ReleaseNotesDialog + + + Qubes Release Notes + + + + + Restore + + + Qubes Restore VMs + + + + + Restore options + + + + + Ignore missing templates or netvms, restore VMs anyway. + + + + + ignore missing + + + + + Ignore dom0 username mismatch while restoring homedir. + + + + + ignore username mismatch + + + + + Verify backup integrity, do not restore the data + + + + + Backup source location + + + + + ... + + + + + <html><head/><body><p>Backup file:<br><span style=" font-size:8pt;">(for old backup format select qubes.xml file)</span></p></body></html> + + + + + AppVM: + + + + + Security options + + + + + Encrypted backup: + + + + + <html><head/><body><p>Decryption / Verification<br/>passphrase:</p></body></html> + + + + + VMs to restore + + + + + You're about to perform the following actions: + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:9pt;"><br /></p></body></html> + + + + + To continue press Next. + + + + + When finished, open file selection dialog to allow me to unmount the disk + + + + + RestoreVMsWindow + + + Restore error! + + + + + Partially restored files left in /var/tmp/restore_*, investigate them and/or clean them up + + + + + Restore aborted! + + + + + Finished with errors! + + + + + Finished successfully! + + + + + Restore aborted + + + + + Do you want to remove temporary files from %s? + + + + + Backup error! + + + + + ERROR: {0} + + + + + Please unmount your backup volume and cancel the file selection dialog. + + + + + Detach backup device + + + + + Aborting the operation... + + + + + SettingsDialog + + + Settings + + + + + <html><head/><body><p>Name &amp;&amp; label<span style=" color:#ff0000;">*</span>:</p></body></html> + + + + + ---- + + + + + <html><head/><body><p>Template<span style=" color:#ff0000;">*</span>:</p></body></html> + + + + + NetVM: + + + + + Include in backups by default + + + + + Run in debug mode + + + + + Start VM automatically on boot + + + + + Seamless GUI + + + + + General + + + + + Type: + + + + + --- + + + + + Installed by RPM: + + + + + Disk storage + + + + + MB + + + + + Private storage max. size: + + + + + System storage max. size: + + + + + Networking + + + + + IP: + + + + + Netmask: + + + + + Gateway: + + + + + <html><head/><body><p><span style=" color:#ff0000;">* </span><span style=" color:#000000;">Cannot be changed while the VM is running</span></p></body></html> + + + + + Basic + + + + + Memory/CPU + + + + + Initial memory: + + + + + Max memory: + + + + + VCPUs no.: + + + + + Include in memory balancing + + + + + Dynamic memory balancing can result in some devices not working! + + + + + Paths + + + + + dir: + + + + + dir_path + + + + + config: + + + + + config_path + + + + + root img: + + + + + root_img_path + + + + + root volatile img: + + + + + volatile_path + + + + + private img: + + + + + private_path + + + + + Other + + + + + NetVM for DispVM: + + + + + Kernel + + + + + Kernel: + + + + + Kernel opts: + + + + + [] + + + + + Additional drive + + + + + Path: + + + + + Backend domain: + + + + + ... + + + + + New drive will be used only at next VM startup + + + + + Advanced + + + + + Allow network access except... + + + + + Allow ICMP traffic + + + + + Deny network access except... + + + + + Allow DNS queries + + + + + Allow connections to Updates Proxy + + + + + Allow full access for + + + + + min + + + + + Firewall rules + + + + + You've enabled dynamic memory balancing, some devices might not work! + + + + + To modify PCI devices you have to turn off the VM. + + + + + Devices + + + + + Applications + + + + + Checked services will be turned on. + + + + + Unchecked services will be turned off. + + + + + Unlisted services will follow default settings. + + + + + Services + + + + + VMSettingsWindow + + + Settings: {vm} + + + + + Applying settings to <b>{0}</b>... + + + + + Error while changing settings for {0}! + + + + + ERROR: {0} + + + + + Error while saving changes: + + + + + Firewall tab: + + + + + Applications tab: + + + + + VM configuration problem! + + + + + The '{vm}' AppVM is not network connected to a FirewallVM!<p>You may edit the '{vm}' VM firewall rules, but these will not take any effect until you connect it to a working Firewall VM. + + + + + (default) + + + + + (current) + + + + + Can't change name of a running VM. + + + + + Can't change VM name - a VM named <b>{0}</b>already exists in the system! + + + + + Warning! + + + + + Max memory can not be less than initial memory.<br>Setting max memory to equal initial memory. + + + + + Initial memory can not be less than one tenth Max memory.<br>Setting initial memory to the minimum allowed value. + + + + + VmListItem + + + VM Shutdown Confirmation + + + + + Are you sure you want to power down the following VMs: <b>{0}</b>?<br/><small>This will shutdown all the running applications within them.</small> + + + + + Wait! + + + + + Some selected VMs are running. Running VMs can not be backuped. Please shut them down or remove them from the list. + + + + + Enter backup target location first. + + + + + Selected directory do not exists or not a directory (%s). + + + + + Enter passphrase for backup encryption/verification first. + + + + + Enter the same passphrase in both fields. + + + + + Error while preparing backup. + + + + + ERROR: {0} + + + + + Backup aborted. + + + + + Backup aborted + + + + + Do you want to remove temporary files from %s? + + + + + Backup error. + + + + + Backup error! + + + + + ERROR: {} + + + + + Backup finished. + + + + + Please unmount your backup volume and cancel the file selection dialog. + + + + + VmManagerWindow + + + Warning! + + + + + This Template VM cannot be removed, because there is at least one AppVM that is based on it.<br><small>If you want to remove this Template VM and all the AppVMs based on it,you should first remove each individual AppVM that uses this template.</small> + + + + + VM Removal Confirmation + + + + + Are you sure you want to remove the VM <b>'{0}'</b>?<br>All data on this VM's private storage will be lost!<br><br>Type the name of the VM (<b>{1}</b>) below to confirm: + + + + + VM removal confirmation failed + + + + + Entered name did not match! Not removing {0}. + + + + + Removing VM: <b>{0}</b>... + + + + + VM '{0}' has been removed. + + + + + Error removing VM! + + + + + ERROR: {0} + + + + + Qubes clone VM + + + + + Enter name for VM <b>{}</b> clone: + + + + + Cloning VM <b>{0}</b> to <b>{1}</b>... + + + + + Error while cloning VM + + + + + Exception while cloning:<br>{0} + + + + + Error unpausing VM! + + + + + Starting '{0}'... + + + + + VM '{0}' has been started. + + + + + Error starting VM <b>'{0}'</b>: {1} + + + + + Error starting VM: %s + + + + + Error starting VM! + + + + + You need to install 'qubes-windows-tools' package to use this option + + + + + VM '{0}' has been started. Start Qubes Tools installation from attached CD + + + + + Error pausing VM! + + + + + VM Shutdown Confirmation + + + + + Are you sure you want to power down the VM <b>'{0}'</b>?<br><small>This will shutdown all the running applications within this VM.</small> + + + + + Error shutting down VM! + + + + + VM '{0}' is shutting down... + + + + + VM Restart Confirmation + + + + + Are you sure you want to restart the VM <b>'{0}'</b>?<br><small>This will shutdown all the running applications within this VM.</small> + + + + + VM Kill Confirmation + + + + + Are you sure you want to kill the VM <b>'{0}'</b>?<br><small>This will end <b>(not shutdown!)</b> all the running applications within this VM.</small> + + + + + Error while killing VM! + + + + + <b>An exception ocurred while killing {0}.</b><br>ERROR: {1} + + + + + VM Update Confirmation + + + + + <b>{0}</b><br>The VM has to be running to be updated.<br>Do you want to start it?<br> + + + + + <b>{0}</b><br>Please wait for the updater to launch... + + + + + Error VM update! + + + + + Qubes command entry + + + + + Run command in <b>{}</b>: + + + + + Error while running command + + + + + Exception while running command:<br>{0} + + + + + Detach {dev} {size} {desc} + + + + + Attach {dev} {size} {desc} + + + + + Block attach/detach error! + + + + + Qubes VM Manager + + + + + Search: + + + + + Nowy wiersz + + + + + Name + + + + + VM name + + + + + State + + + + + Update info + + + + + Template + + + + + VM's template + + + + + NetVM + + + + + VM's netVM + + + + + CPU + + + + + CPU Graph + + + + + CPU usage graph + + + + + MEM + + + + + MEM Graph + + + + + Memory usage graph + + + + + Size + + + + + Internal + + + + + IP + + + + + Backups + + + + + Last backup + + + + + &System + + + + + &View + + + + + V&M + + + + + &Logs + + + + + Attach/detach &block devices + + + + + &About + + + + + toolBar + + + + + Create &New VM + + + + + Create a new VM + + + + + &Delete VM + + + + + Remove an existing VM (must be stopped first) + + + + + Start/Resume V&M + + + + + Start/Resume selected VM + + + + + &Pause VM + + + + + Pause selected VM + + + + + &Shutdown VM + + + + + Shutdown selected VM + + + + + Restar&t VM + + + + + Restart selected VM + + + + + Add/remove app s&hortcuts + + + + + Add/remove app shortcuts for this VM + + + + + &Update VM + + + + + Update VM system + + + + + Attach/detach &audio-input to the VM + + + + + Attach/detach audio-input to the VM + + + + + Show/Hide inactive VMs + + + + + Edit VM &firewall rules + + + + + Edit VM firewall rules + + + + + Show graphs + + + + + Show Graphs + + + + + Options + + + + + View + + + + + &CPU + + + + + CPU &Graph + + + + + &MEM + + + + + M&EM Graph + + + + + &Template + + + + + &NetVM + + + + + VM s&ettings + + + + + VM Settings + + + + + &Restore VMs from backup + + + + + &Backup VMs + + + + + &Global settings + + + + + &State + + + + + &Kill VM + + + + + Kill selected VM + + + + + Set keyboard la&yout + + + + + Set keyboard layout per VM + + + + + T&ype + + + + + VM Type + + + + + &Label + + + + + N&ame + + + + + Show tool bar + + + + + Show menu bar + + + + + &Qubes OS + + + + + Si&ze + + + + + Size on Disk + + + + + &Run command in VM + + + + + Run command in the specified VM + + + + + &Clone VM + + + + + Inte&rnal + + + + + Is an internal VM + + + + + Show/Hide internal VMs + + + + + Start VM for Window Tools installation + + + + + &IP + + + + + Include in &backups + + + + + Last back&up + + + + + Search + + + + + Ctrl+F + + + + + VmShutdownMonitor + + + VM Shutdown + + + + + The VM <b>'{0}'</b> hasn't shutdown within the last {1} seconds, do you want to kill it?<br> + + + + + Kill it! + + + + + Wait another {0} seconds... + + + + + VmUpdateInfoItem + + + Updates pending! + + + + + The VM must be restarted for its filesystem to reflect the template's recent committed changes. + + + + + The TemplateVM must be stopped before changes from its current session can be picked up by this VM. + + + + + dialog + + + Select backup location. + + + + diff --git a/qubesmanager.pro b/qubesmanager.pro index e6172f4..9b8b95a 100644 --- a/qubesmanager.pro +++ b/qubesmanager.pro @@ -40,7 +40,9 @@ SOURCES = \ qubesmanager/ui_restoredlg.py \ qubesmanager/ui_settingsdlg.py -TRANSLATIONS = i18n/qubesmanager_es.ts +TRANSLATIONS = \ + i18n/qubesmanager_en.ts \ + i18n/qubesmanager_es.ts CODECFORTR = UTF-8 From c8e237490b8e205286a9e88b29afd14d333110f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 3 Feb 2017 17:22:02 +0100 Subject: [PATCH 6/7] i18n: add configuration for transifex client QubesOS/qubes-issues#2599 --- .tx/config | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 .tx/config diff --git a/.tx/config b/.tx/config new file mode 100644 index 0000000..1f4c495 --- /dev/null +++ b/.tx/config @@ -0,0 +1,7 @@ +[main] +host = https://www.transifex.com + +[qubes.qubes_manager] +file_filter = i18n/qubesmanager_.ts +source_lang = en +type = QT From 3884d6836fe927fbda13527efdceb3fcc1c6869d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Fri, 3 Feb 2017 17:22:33 +0100 Subject: [PATCH 7/7] i18n: update translations QubesOS/qubes-issues#2599 --- i18n/qubesmanager_es.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/i18n/qubesmanager_es.ts b/i18n/qubesmanager_es.ts index 78bab07..7213270 100644 --- a/i18n/qubesmanager_es.ts +++ b/i18n/qubesmanager_es.ts @@ -634,7 +634,7 @@ p, li { white-space: pre-wrap; } ... - + ... @@ -669,7 +669,7 @@ p, li { white-space: pre-wrap; } You're about to perform the following actions: - + Se van a realizar las siguientes operaciones: @@ -683,12 +683,12 @@ p, li { white-space: pre-wrap; } To continue press Next. - + Para continuar oprima Siguiente. When finished, open file selection dialog to allow me to unmount the disk - + Al terminar, abrir el diálogo de selección de archivos para permitir desmontar la unidad @@ -1004,7 +1004,7 @@ p, li { white-space: pre-wrap; } ... - + ...