From fb75cb0864106cdd6d60e3f7fe54079f020ae77b Mon Sep 17 00:00:00 2001 From: Alexander Minges Date: Wed, 8 Jul 2015 02:13:28 +0200 Subject: [PATCH] Preparing translations; Added de_DE --- i18n/de_DE.qm | Bin 0 -> 6420 bytes i18n/de_DE.ts | 245 +++++++++++++++++++++++++++++++++++++++++++++++ i18n/template.ts | 23 +++-- main.py | 8 +- pydsf.pro | 5 + ui/mainwindow.py | 41 ++++---- 6 files changed, 290 insertions(+), 32 deletions(-) create mode 100644 i18n/de_DE.qm create mode 100644 i18n/de_DE.ts create mode 100644 pydsf.pro diff --git a/i18n/de_DE.qm b/i18n/de_DE.qm new file mode 100644 index 0000000000000000000000000000000000000000..1776c64abfd6ae46b6cb194c219dbc867b01470c GIT binary patch literal 6420 zcmcE7ks@*G{hX<16=n7(EZlq7iGhK!fPv+}5e5c9RR-1>M;RCx3K+C|SQr?X_!xX< zCNVGw1~K^TRb^lhJkH?DbeMrb@H>Owz6%TtLh%g2xrZ1Sgw8O8-z;Nb5D8^y@tw}V zz~sc(ueOqbL2M%9Pu<513=9lR_OJ687&zWCEuVITfq^lRY0X~)1_r?s(!?s&(*z;4Ys_uF9x2H`baCT&X@7zAE(O*ub_ zfq~zXYt7bY3=E7HxOPaFGB7Y~;x;UL#=s!1$8GF1A~xr zeqLH;dTCLrLUCzQK~8>2F*^eTgSc~PaY=rzUt(EidSXdteqKm^eoj(i5hKVxA%=??~nZ8<|KLk>d@1BfnS zD1qx|S92~c$xlnerdxnPjlqc_6&(91AQG;NRV}bI6RV4L7}OX77>XG38LAjk8HyQ- zp(zCsGbLdEfYKNut_9VCOA?Dp6atF!lT(X}GxO51xrdKIjlmxhc%ZO=yM|3Iw4fjr zYXBrL*f3-;lrZEnCpTkhXphr@G zw_^`*$CMO>l*E!mg|y6^)MAB_d~jw@ttdz>%FIp8E74Q%OjF1$%_+$&$N?1sAVrBq zsR}vyi7BZmIv~}R3Lt@!qSVBa)D(rpVuhmAf}G6c#FErvJ>ufgg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9>pewkypURNL0BV7P`fQ+d1Inx@J#z+oxZ^aO6LXSFbHE{43@)l6k^+XR#VF@^!a^&P1F0qW9#1|!g&SI+Q+ zAp_iOMRX&@oipFx_~+mZkajY@dxxyIj9fs z3hB1Mb+EYRsik1EhKIq8ArXux}4CCBv${UcBw(}Q^lab@Qndf z_=AgNc$o0{7o_GP48`U@9cU9CQj?&LvlKJrGZcUe9%xw)H&_TU#G>F|02+_O8o#jq z0XD<+81xwQ;0E#{4Aj%p!{$&fh5&|21{a241~<4a)__WvU^i^4g)j#T;JUbi;2m*n zT6q}M7=jrd9PH>q9s%Ws8qQZdOQ&WTX=|Jsq zYy)nB!H~|5T1W=8gM-b?I21D>#WtFW44_^DC~tuJZ`lkb45i?)s~iRpzmy@3L4g6( zX92kZGH3(pIg~I|fd*ROKGTA_rUd2~P`4_%w5TXGuOz2Zp*Xb!)VZokEy~9lwR#NL zS`MIEBM+&K02%v39xE0JL8_IDQ%g!R^U|@VLnE*S6$~W|pk6VkZv-x(7!(*Z7_=Dl z7)lsGatdH}GD9G|O=ZxSJ?6(!JNAPp_Ol8O=qExqL8GEHm&&c_fA9+!mHn{Y$e z!xM}0aEwQ)F@%E)vmAzOhJ1!x@c0=hA%R*|pbUhb=mo-4bCUCOQ$azBHT`#h<|Y^! E0cE3v1^@s6 literal 0 HcmV?d00001 diff --git a/i18n/de_DE.ts b/i18n/de_DE.ts new file mode 100644 index 0000000..7a29c35 --- /dev/null +++ b/i18n/de_DE.ts @@ -0,0 +1,245 @@ + + + + + CustomNavigationToolbar + + + Save + Speichern + + + + Save the figure + Abbildung speichern + + + + Subplots + Untergrafiken + + + + Configure subplots + Untergrafiken formatieren + + + + MainWindow + + + &Start Processing + &Prozessierung starten + + + + Open data file + Datensatz öffnen + + + + Text files (*.txt *.csv) + Textdateien (*.txt *.csv) + + + + Error + Fehler + + + + No data file loaded! + Kein Datensatz geladen! + + + + Warning + Warnung + + + + Signal threshold is currently set to zero. + Signalschwellwert ist aktuell auf Null gesetzt. + + + + Processing... + Prozessierung... + + + + Save data + Daten speichern + + + + Calculations are finished. Save results? + Berechnungen abgeschlossen. Ergebnisse speichern? + + + + Choose path for results + Pfad zum Speichern der Ergebnisse wählen + + + + Finished! + Fertig! + + + + PyDSF + PyDSF + + + + Experimental Setup + Experiment + + + + Instrument + Instrument + + + + Analytik Jena qTOWER 2.0/2.2 + Analytik Jena qTOWER 2.0/2.2 + + + + <html><head/><body><p>Add data files to the experiment. If multiple files are loaded, they are treated as replicates.</p></body></html> + <html><head/><body><p>Daten zum Experiment hinzufügen. Werden mehrere Datensätze geladen, werden diese als Replikate behandelt.</p></body></html> + + + + Data File + Datensatz + + + + Replicates + Replikate + + + + Files + Dateien + + + + Processing Options + Prozessierungsoptionen + + + + <html><head/><body><p>Temperature range of the data points. Only applies, if the data file does not contain any temperature information.</p></body></html> + <html><head/><body><p>Temperaturbereich des Datensatzes. Trifft nur zu, falls der Datensatz selbst keine Informationen zum Temperaturbereich bereitstellt.</p></body></html> + + + + Temperature settings + Temperatureinstellungen + + + + <html><head/><body><p>T<span style=" vertical-align:sub;">min</span></p></body></html> + <html><head/><body><p>T<span style=" vertical-align:sub;">min</span></p></body></html> + + + + °C + °C + + + + <html><head/><body><p>T<span style=" vertical-align:sub;">max</span></p></body></html> + <html><head/><body><p>T<span style=" vertical-align:sub;">max</span></p></body></html> + + + + <html><head/><body><p>&Delta;T</p></body></html> + <html><head/><body><p>&Delta;T</p></body></html> + + + + <html><head/><body><p>Only T<span style=" vertical-align:sub;">m</span> values within this limit are considered valid.</p></body></html> + <html><head/><body><p>Nur T<span style=" vertical-align:sub;">m</span>-Werte innerhalb dieser Grenzen werden als gültig betrachtet.</p></body></html> + + + + &Cutoff + &Schwellwert + + + + &Upper + &Oberer + + + + Lower + Unterer + + + + <html><head/><body><p>If the signal exceeds this threshold, the coresponding well is assumed to be denatured.</p></body></html> + <html><head/><body><p>Überschreitet das Signal diesen Schwellwert, wird die zugehörige Probe als denaturiert betrachtet.</p></body></html> + + + + Signal &Threshold + Signal&schwellwert + + + + <html><head/><body><p>Defines the range of the colorbar used for the T<span style=" vertical-align:sub;">m</span> heatmap.</p></body></html> + <html><head/><body><p>Definiert den Bereich des Farbverlaufs, welcher für die T<span style=" vertical-align:sub;">m</span> Heatmap verwendet wird.</p></body></html> + + + + &Colorbar + &Farbverlauf + + + + S&tart + &Start + + + + En&d + &Ende + + + + Fi&le + &Datei + + + + Hel&p + &Hilfe + + + + &Quit + &Beenden + + + + &About + &Über + + + + About &Qt + Über &Qt + + + + Welcome to PyDSF + Willkommen zu PyDSF + + + diff --git a/i18n/template.ts b/i18n/template.ts index d06549c..eeb8c88 100644 --- a/i18n/template.ts +++ b/i18n/template.ts @@ -26,27 +26,27 @@ MainWindow - + &Start Processing - + Open data file - + Text files (*.txt *.csv) - + Error - + No data file loaded! @@ -66,22 +66,22 @@ - + Save data - + Calculations are finished. Save results? - + Choose path for results - + Finished! @@ -235,5 +235,10 @@ About &Qt + + + Welcome to PyDSF + + diff --git a/main.py b/main.py index e30c52c..0ea71c9 100644 --- a/main.py +++ b/main.py @@ -1,7 +1,8 @@ #!/usr/bin/env python2 # -*- coding: utf-8 -*- -from PyQt5 import QtWidgets +import glob +from PyQt5 import QtWidgets, QtCore from ui.mainwindow import MainWindow @@ -10,6 +11,11 @@ if __name__ == "__main__": import sys app = QtWidgets.QApplication(sys.argv) + translationFiles = glob.glob("i18n/*.qm") + translator = QtCore.QTranslator() + for translationFile in translationFiles: + translator.load(translationFile) + app.installTranslator(translator) ui = MainWindow() ui.show() sys.exit(app.exec_()) diff --git a/pydsf.pro b/pydsf.pro new file mode 100644 index 0000000..9128f57 --- /dev/null +++ b/pydsf.pro @@ -0,0 +1,5 @@ +SOURCES += ui/mainwindow.py +SOURCES += ui/Ui_mainwindow.py +SOURCES += ui/mplwidget.py +SOURCES += pydsf.py +TRANSLATIONS += i18n/de_DE.ts diff --git a/ui/mainwindow.py b/ui/mainwindow.py index 668d7a1..9596b38 100644 --- a/ui/mainwindow.py +++ b/ui/mainwindow.py @@ -12,6 +12,7 @@ from .mplwidget import MplWidget from pydsf import Experiment, PlotResults VERSION = "1.0" +_translate = QCoreApplication.translate class WorkerSignals(QObject): @@ -114,10 +115,11 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.progressBar.setMaximum(0) self.progressBar.setEnabled(False) self.statusBar.addPermanentWidget(self.progressBar) - self.statusBar.showMessage("Welcome to PyDSF") + self.statusBar.showMessage(_translate("MainWindow", + "Welcome to PyDSF")) self.buttonBox_process.addButton( - QCoreApplication.translate("MainWindow", "&Start Processing"), + _translate("MainWindow", "&Start Processing"), QDialogButtonBox.AcceptRole) self.tasks = Tasks() @@ -131,9 +133,8 @@ class MainWindow(QMainWindow, Ui_MainWindow): if button == self.buttonBox_open_reset.button(QDialogButtonBox.Open): filenames = QFileDialog.getOpenFileNames( self, - QCoreApplication.translate("MainWindow", "Open data file"), '', - QCoreApplication.translate("MainWindow", - "Text files (*.txt *.csv)")) + _translate("MainWindow", "Open data file"), '', + _translate("MainWindow", "Text files (*.txt *.csv)")) self.listWidget_data.addItems(filenames[0]) if self.listWidget_data.count() > 1: self.groupBox_replicates.setChecked(True) @@ -162,22 +163,22 @@ class MainWindow(QMainWindow, Ui_MainWindow): if id != 'average': tab = self.generate_plot_tab("tab_heatmap_{}".format(id)) - self.tabWidget.addTab(tab, QCoreApplication.translate( + self.tabWidget.addTab(tab, _translate( "MainWindow", "Heatmap #{}".format(plate.id))) plotter.plot_tm_heatmap_single(plate, tab) tab = self.generate_plot_tab("tab_raw_{}".format(id)) - self.tabWidget.addTab(tab, QCoreApplication.translate( + self.tabWidget.addTab(tab, _translate( "MainWindow", "Raw Data #{}".format(plate.id))) plotter.plot_raw(plate, tab) tab = self.generate_plot_tab("tab_derivative_{}".format(id)) - self.tabWidget.addTab(tab, QCoreApplication.translate( + self.tabWidget.addTab(tab, _translate( "MainWindow", "Derivatives #{}".format(plate.id))) plotter.plot_derivative(plate, tab) else: tab = self.generate_plot_tab("tab_heatmap_{}".format(id)) - self.tabWidget.addTab(tab, QCoreApplication.translate( + self.tabWidget.addTab(tab, _translate( "MainWindow", "Heatmap ({})".format(plate.id))) plotter.plot_tm_heatmap_single(plate, tab) @@ -189,23 +190,21 @@ class MainWindow(QMainWindow, Ui_MainWindow): if self.listWidget_data.count() < 1: QMessageBox.critical( - self, QCoreApplication.translate("MainWindow", "Error"), - QCoreApplication.translate("MainWindow", - "No data file loaded!"), + self, _translate("MainWindow", "Error"), + _translate("MainWindow", "No data file loaded!"), QMessageBox.Close, QMessageBox.Close) return if self.spinBox_signal_threshold.value( ) == 0 and self.groupBox_signal_threshold.isChecked(): QMessageBox.warning( - self, QCoreApplication.translate("MainWindow", "Warning"), - QCoreApplication.translate( + self, _translate("MainWindow", "Warning"), + _translate( "MainWindow", "Signal threshold is currently set to zero."), QMessageBox.Ok, QMessageBox.Ok) self.progressBar.setEnabled(True) - self.statusBar.showMessage(QCoreApplication.translate("MainWindow", - "Processing...")) + self.statusBar.showMessage(_translate("MainWindow", "Processing...")) self.tasks.signals.finished.connect(self.on_processing_finished) self.tasks.add_task(self.worker) @@ -217,16 +216,15 @@ class MainWindow(QMainWindow, Ui_MainWindow): exp = self.tasks.data[0] save_data = QMessageBox.question( - self, QCoreApplication.translate("MainWindow", "Save data"), - QCoreApplication.translate( + self, _translate("MainWindow", "Save data"), + _translate( "MainWindow", "Calculations are finished. Save results?"), QMessageBox.Yes | QMessageBox.No, QMessageBox.Yes) if save_data == QMessageBox.Yes: dialog = QFileDialog() dialog.setFileMode(QFileDialog.Directory) folder = dialog.getExistingDirectory( - self, QCoreApplication.translate("MainWindow", - "Choose path for results")) + self, _translate("MainWindow", "Choose path for results")) for plate in exp.plates: plate.write_tm_table( '{}/plate_{}_04_tm.csv'.format(folder, str(plate.id))) @@ -254,8 +252,7 @@ class MainWindow(QMainWindow, Ui_MainWindow): self.generate_plate_tabs(plate) self.progressBar.setEnabled(False) - self.statusBar.showMessage(QCoreApplication.translate("MainWindow", - "Finished!")) + self.statusBar.showMessage(_translate("MainWindow", "Finished!")) @pyqtSlot() def on_buttonBox_process_rejected(self):