Use gettext translation in PyQT GUI client

This commit is contained in:
Bastian Kleineidam 2009-03-04 22:41:25 +01:00
parent 48b0ac686d
commit 2890e879a3
4 changed files with 63 additions and 62 deletions

View file

@ -9,6 +9,7 @@ all: $(UI_FILES) $(RC_FILES)
linkchecker_ui_%.py: ui/%.ui
pyuic4 -o $@ $<
sed -i -r -e 's/QtGui\.QApplication\.translate\("[^"]+", "([^"]+)", None, QtGui\.QApplication\.UnicodeUTF8\)/_("\1")/g' $@
linkchecker_rc.py: rc/linkchecker.qrc
pyrcc4 -o $@ $<

View file

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/main.ui'
#
# Created: Mon Mar 2 23:21:42 2009
# Created: Wed Mar 4 21:30:14 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
@ -86,21 +86,21 @@ class Ui_MainWindow(object):
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(QtGui.QApplication.translate("MainWindow", "LinkChecker", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("MainWindow", "URL", None, QtGui.QApplication.UnicodeUTF8))
self.optionsButton.setText(QtGui.QApplication.translate("MainWindow", "Options...", None, QtGui.QApplication.UnicodeUTF8))
self.controlButton.setToolTip(QtGui.QApplication.translate("MainWindow", "Start checking the given URL.", None, QtGui.QApplication.UnicodeUTF8))
self.controlButton.setText(QtGui.QApplication.translate("MainWindow", "Start", None, QtGui.QApplication.UnicodeUTF8))
self.treeWidget.headerItem().setText(0, QtGui.QApplication.translate("MainWindow", "#", None, QtGui.QApplication.UnicodeUTF8))
self.treeWidget.headerItem().setText(1, QtGui.QApplication.translate("MainWindow", "Parent", None, QtGui.QApplication.UnicodeUTF8))
self.treeWidget.headerItem().setText(2, QtGui.QApplication.translate("MainWindow", "Url", None, QtGui.QApplication.UnicodeUTF8))
self.treeWidget.headerItem().setText(3, QtGui.QApplication.translate("MainWindow", "Name", None, QtGui.QApplication.UnicodeUTF8))
self.treeWidget.headerItem().setText(4, QtGui.QApplication.translate("MainWindow", "Result", None, QtGui.QApplication.UnicodeUTF8))
self.menuLinkChecka.setTitle(QtGui.QApplication.translate("MainWindow", "File", None, QtGui.QApplication.UnicodeUTF8))
self.menuHelp.setTitle(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8))
self.actionQuit.setText(QtGui.QApplication.translate("MainWindow", "Quit", None, QtGui.QApplication.UnicodeUTF8))
self.actionQuit.setShortcut(QtGui.QApplication.translate("MainWindow", "Ctrl+Q", None, QtGui.QApplication.UnicodeUTF8))
self.actionAbout.setText(QtGui.QApplication.translate("MainWindow", "About", None, QtGui.QApplication.UnicodeUTF8))
self.actionHelp.setText(QtGui.QApplication.translate("MainWindow", "Help", None, QtGui.QApplication.UnicodeUTF8))
MainWindow.setWindowTitle(_("LinkChecker"))
self.label.setText(_("URL"))
self.optionsButton.setText(_("Options..."))
self.controlButton.setToolTip(_("Start checking the given URL."))
self.controlButton.setText(_("Start"))
self.treeWidget.headerItem().setText(0, _("#"))
self.treeWidget.headerItem().setText(1, _("Parent"))
self.treeWidget.headerItem().setText(2, _("Url"))
self.treeWidget.headerItem().setText(3, _("Name"))
self.treeWidget.headerItem().setText(4, _("Result"))
self.menuLinkChecka.setTitle(_("File"))
self.menuHelp.setTitle(_("Help"))
self.actionQuit.setText(_("Quit"))
self.actionQuit.setShortcut(_("Ctrl+Q"))
self.actionAbout.setText(_("About"))
self.actionHelp.setText(_("Help"))
import linkchecker_rc

View file

@ -2,8 +2,8 @@
# Form implementation generated from reading ui file 'ui/options.ui'
#
# Created: Sun Jan 11 11:30:58 2009
# by: PyQt4 UI code generator 4.4.2
# Created: Wed Mar 4 21:31:00 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
@ -12,72 +12,72 @@ from PyQt4 import QtCore, QtGui
class Ui_Options(object):
def setupUi(self, Options):
Options.setObjectName("Options")
Options.resize(306,255)
Options.resize(306, 255)
self.resetButton = QtGui.QPushButton(Options)
self.resetButton.setGeometry(QtCore.QRect(200,220,91,27))
self.resetButton.setGeometry(QtCore.QRect(200, 220, 91, 27))
self.resetButton.setObjectName("resetButton")
self.frame = QtGui.QFrame(Options)
self.frame.setGeometry(QtCore.QRect(9,9,288,201))
self.frame.setGeometry(QtCore.QRect(9, 9, 288, 201))
self.frame.setFrameShape(QtGui.QFrame.StyledPanel)
self.frame.setFrameShadow(QtGui.QFrame.Raised)
self.frame.setObjectName("frame")
self.recursionlevel = QtGui.QSpinBox(self.frame)
self.recursionlevel.setGeometry(QtCore.QRect(130,20,46,23))
self.recursionlevel.setGeometry(QtCore.QRect(130, 20, 46, 23))
self.recursionlevel.setMinimum(-1)
self.recursionlevel.setMaximum(100)
self.recursionlevel.setProperty("value",QtCore.QVariant(-1))
self.recursionlevel.setProperty("value", QtCore.QVariant(-1))
self.recursionlevel.setObjectName("recursionlevel")
self.label = QtGui.QLabel(self.frame)
self.label.setGeometry(QtCore.QRect(30,20,111,20))
self.label.setGeometry(QtCore.QRect(30, 20, 111, 20))
self.label.setObjectName("label")
self.label_2 = QtGui.QLabel(self.frame)
self.label_2.setGeometry(QtCore.QRect(30,60,91,17))
self.label_2.setGeometry(QtCore.QRect(30, 60, 91, 17))
self.label_2.setObjectName("label_2")
self.label_3 = QtGui.QLabel(self.frame)
self.label_3.setGeometry(QtCore.QRect(30,100,48,17))
self.label_3.setGeometry(QtCore.QRect(30, 100, 48, 17))
self.label_3.setObjectName("label_3")
self.timeout = QtGui.QSpinBox(self.frame)
self.timeout.setGeometry(QtCore.QRect(130,100,81,23))
self.timeout.setGeometry(QtCore.QRect(130, 100, 81, 23))
self.timeout.setMinimum(2)
self.timeout.setMaximum(300)
self.timeout.setProperty("value",QtCore.QVariant(60))
self.timeout.setProperty("value", QtCore.QVariant(60))
self.timeout.setObjectName("timeout")
self.label_5 = QtGui.QLabel(self.frame)
self.label_5.setGeometry(QtCore.QRect(30,140,101,17))
self.label_5.setGeometry(QtCore.QRect(30, 140, 101, 17))
self.label_5.setObjectName("label_5")
self.threads = QtGui.QSpinBox(self.frame)
self.threads.setGeometry(QtCore.QRect(130,140,46,23))
self.threads.setGeometry(QtCore.QRect(130, 140, 46, 23))
self.threads.setMinimum(1)
self.threads.setMaximum(20)
self.threads.setProperty("value",QtCore.QVariant(10))
self.threads.setProperty("value", QtCore.QVariant(10))
self.threads.setObjectName("threads")
self.verbose = QtGui.QCheckBox(self.frame)
self.verbose.setEnabled(True)
self.verbose.setGeometry(QtCore.QRect(130,60,31,22))
self.verbose.setGeometry(QtCore.QRect(130, 60, 31, 22))
self.verbose.setObjectName("verbose")
self.closeButton = QtGui.QPushButton(Options)
self.closeButton.setGeometry(QtCore.QRect(10,220,75,27))
self.closeButton.setGeometry(QtCore.QRect(10, 220, 75, 27))
self.closeButton.setObjectName("closeButton")
self.retranslateUi(Options)
QtCore.QMetaObject.connectSlotsByName(Options)
def retranslateUi(self, Options):
Options.setWindowTitle(QtGui.QApplication.translate("Options", "Dialog", None, QtGui.QApplication.UnicodeUTF8))
self.resetButton.setToolTip(QtGui.QApplication.translate("Options", "Reset all options to default values.", None, QtGui.QApplication.UnicodeUTF8))
self.resetButton.setText(QtGui.QApplication.translate("Options", "Reset", None, QtGui.QApplication.UnicodeUTF8))
self.recursionlevel.setToolTip(QtGui.QApplication.translate("Options", "Check recursively all links up to given depth. A negative depth will enable infinite recursion.", None, QtGui.QApplication.UnicodeUTF8))
self.label.setToolTip(QtGui.QApplication.translate("Options", "Check recursively all links up to given depth. A negative depth will enable infinite recursion.", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Options", "Recursive depth", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setToolTip(QtGui.QApplication.translate("Options", "Log all checked URLs once. Default is to log only errors and warnings.", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("Options", "Verbose output", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setToolTip(QtGui.QApplication.translate("Options", "Set the timeout for connection attempts in seconds.", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("Options", "Timeout", None, QtGui.QApplication.UnicodeUTF8))
self.timeout.setToolTip(QtGui.QApplication.translate("Options", "Set the timeout for connection attempts in seconds.", None, QtGui.QApplication.UnicodeUTF8))
self.timeout.setSuffix(QtGui.QApplication.translate("Options", " seconds", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setToolTip(QtGui.QApplication.translate("Options", "Generate no more than the given number of threads.", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("Options", "Number of threads", None, QtGui.QApplication.UnicodeUTF8))
self.threads.setToolTip(QtGui.QApplication.translate("Options", "Generate no more than the given number of threads.", None, QtGui.QApplication.UnicodeUTF8))
self.verbose.setToolTip(QtGui.QApplication.translate("Options", "Log all checked URLs once. Default is to log only errors and warnings.", None, QtGui.QApplication.UnicodeUTF8))
self.closeButton.setText(QtGui.QApplication.translate("Options", "Close", None, QtGui.QApplication.UnicodeUTF8))
Options.setWindowTitle(_("Dialog"))
self.resetButton.setToolTip(_("Reset all options to default values."))
self.resetButton.setText(_("Reset"))
self.recursionlevel.setToolTip(_("Check recursively all links up to given depth. A negative depth will enable infinite recursion."))
self.label.setToolTip(_("Check recursively all links up to given depth. A negative depth will enable infinite recursion."))
self.label.setText(_("Recursive depth"))
self.label_2.setToolTip(_("Log all checked URLs once. Default is to log only errors and warnings."))
self.label_2.setText(_("Verbose output"))
self.label_3.setToolTip(_("Set the timeout for connection attempts in seconds."))
self.label_3.setText(_("Timeout"))
self.timeout.setToolTip(_("Set the timeout for connection attempts in seconds."))
self.timeout.setSuffix(_(" seconds"))
self.label_5.setToolTip(_("Generate no more than the given number of threads."))
self.label_5.setText(_("Number of threads"))
self.threads.setToolTip(_("Generate no more than the given number of threads."))
self.verbose.setToolTip(_("Log all checked URLs once. Default is to log only errors and warnings."))
self.closeButton.setText(_("Close"))

View file

@ -2,7 +2,7 @@
# Form implementation generated from reading ui file 'ui/progress.ui'
#
# Created: Tue Feb 24 21:40:49 2009
# Created: Wed Mar 4 21:31:01 2009
# by: PyQt4 UI code generator 4.4.4
#
# WARNING! All changes made in this file will be lost!
@ -70,14 +70,14 @@ class Ui_ProgressDialog(object):
QtCore.QMetaObject.connectSlotsByName(ProgressDialog)
def retranslateUi(self, ProgressDialog):
ProgressDialog.setWindowTitle(QtGui.QApplication.translate("ProgressDialog", "LinkChecker progress", None, QtGui.QApplication.UnicodeUTF8))
self.cancelButton.setText(QtGui.QApplication.translate("ProgressDialog", "Cancel", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("ProgressDialog", "Active:", None, QtGui.QApplication.UnicodeUTF8))
self.label_active.setText(QtGui.QApplication.translate("ProgressDialog", "0", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("ProgressDialog", "Queued:", None, QtGui.QApplication.UnicodeUTF8))
self.label_queued.setText(QtGui.QApplication.translate("ProgressDialog", "0", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("ProgressDialog", "Checked:", None, QtGui.QApplication.UnicodeUTF8))
self.label_checked.setText(QtGui.QApplication.translate("ProgressDialog", "0", None, QtGui.QApplication.UnicodeUTF8))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), QtGui.QApplication.translate("ProgressDialog", "Status", None, QtGui.QApplication.UnicodeUTF8))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), QtGui.QApplication.translate("ProgressDialog", "Debug", None, QtGui.QApplication.UnicodeUTF8))
ProgressDialog.setWindowTitle(_("LinkChecker progress"))
self.cancelButton.setText(_("Cancel"))
self.label.setText(_("Active:"))
self.label_active.setText(_("0"))
self.label_2.setText(_("Queued:"))
self.label_queued.setText(_("0"))
self.label_3.setText(_("Checked:"))
self.label_checked.setText(_("0"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _("Status"))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _("Debug"))