From 624b6f697210297147956e3fa23c37b60725cba9 Mon Sep 17 00:00:00 2001 From: NaruX Date: Thu, 29 Jun 2017 12:48:22 +0200 Subject: [PATCH] RevPiPlcList vor Schlie?en sch?tzen Quelltext f?r ?bersetzung angepasst ?bersetzung mit poedit durchgef?hrt --- .../locale/de/LC_MESSAGES/revpipycontrol.po | 551 ++++++++++++++++++ revpipycontrol/mytools.py | 2 +- revpipycontrol/revpicheckclient.py | 18 +- revpipycontrol/revpilogfile.py | 14 +- revpipycontrol/revpioption.py | 68 ++- revpipycontrol/revpiplclist.py | 43 +- revpipycontrol/revpiprogram.py | 13 +- revpipycontrol/revpipycontrol.py | 36 +- 8 files changed, 663 insertions(+), 82 deletions(-) create mode 100644 revpipycontrol/locale/de/LC_MESSAGES/revpipycontrol.po diff --git a/revpipycontrol/locale/de/LC_MESSAGES/revpipycontrol.po b/revpipycontrol/locale/de/LC_MESSAGES/revpipycontrol.po new file mode 100644 index 0000000..6b325a0 --- /dev/null +++ b/revpipycontrol/locale/de/LC_MESSAGES/revpipycontrol.po @@ -0,0 +1,551 @@ +msgid "" +msgstr "" +"Project-Id-Version: RevPiPyControl 0.4.0\n" +"POT-Creation-Date: 2017-06-29 12:39+0200\n" +"PO-Revision-Date: 2017-06-29 12:39+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"X-Poedit-Basepath: ../../..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-SearchPath-0: .\n" + +#: revpicheckclient.py:143 +msgid "Devices of RevPi" +msgstr "Devices vom RevPi" + +#: revpicheckclient.py:175 +msgid "Control" +msgstr "Kontrolle" + +#: revpicheckclient.py:179 +msgid "Read all IOs" +msgstr "IOs aktualisieren" + +#: revpicheckclient.py:184 +msgid "Read just Inputs" +msgstr "Inputs lesen" + +#: revpicheckclient.py:189 +msgid "Write Outputs" +msgstr "Outputs schreiben" + +#: revpicheckclient.py:195 +msgid "Autorefresh values" +msgstr "Aktualisiere automatisch" + +#: revpicheckclient.py:201 +msgid "Write values to RevPi" +msgstr "Schreibe Werte auf RevPi" + +#: revpilogfile.py:27 +msgid "RevPi Python PLC Logs" +msgstr "RevPi Python PLC Logdaten" + +#: revpilogfile.py:40 +msgid "RevPiPyLoad - Logfile" +msgstr "RevPiPyLoad - Logdatei" + +#: revpilogfile.py:44 revpilogfile.py:59 +msgid "Clear screen" +msgstr "Leere Ansicht" + +#: revpilogfile.py:55 +msgid "Python PLC program - Logfile" +msgstr "Python PLC Programm - Logdatei" + +#: revpioption.py:33 +msgid "RevPi Python PLC Options" +msgstr "RevPi Python PLC Einstellungen" + +#: revpioption.py:41 +msgid "Start / Stop behavior" +msgstr "Start / Stop Verhalten" + +#: revpioption.py:50 +msgid "Start program automatically" +msgstr "Starte Programm automatisch" + +#: revpioption.py:56 +msgid "Restart program after exit" +msgstr "Starte Programm nach Beenden neu" + +#: revpioption.py:63 +msgid "" +"Set process image to NULL if program\n" +"terminates successfully" +msgstr "" +"\"Prozessabbild auf NULL setzen, wenn Programm\n" +"\"erfolgreich beendet wird\"" + +#: revpioption.py:70 +msgid "" +"Set process image to NULL if program\n" +"terminates with errors" +msgstr "" +"Prozessabbild auf NULL setzen, wenn Programm\n" +"fehlerhaft beendet wird" + +#: revpioption.py:77 +msgid "PLC program" +msgstr "PLC Programm" + +#: revpioption.py:88 +msgid "Python version" +msgstr "Python Version" + +#: revpioption.py:105 +msgid "Python PLC program name" +msgstr "Python PLC Programmname" + +#: revpioption.py:117 +msgid "Program arguments" +msgstr "Programmargumente" + +#: revpioption.py:126 +msgid "Use RevPi as PLC-Slave" +msgstr "RevPi als PLC-Slave verwenden" + +#: revpioption.py:133 +msgid "XML-RPC server" +msgstr "XML-RPC Server" + +#: revpioption.py:145 +msgid "Activate XML-RPC server on RevPi" +msgstr "Aktiviere XML-RPC Server auf RevPi" + +#: revpioption.py:153 +msgid "" +"Allow download of piCtory configuration and\n" +"PLC programm" +msgstr "" +"Download von piCtroy Konfiguration und\n" +"PLC Programm zulassen" + +#: revpioption.py:160 +msgid "" +"Allow upload of piCtory configuration and\n" +"PLC programm" +msgstr "" +"Hochladen von piCtroy Konfiguration und\n" +"PLC Programm zulassen" + +#: revpioption.py:165 +msgid "XML-RPC server port" +msgstr "XML-RPC Serverport" + +#: revpioption.py:179 revpiplclist.py:112 +msgid "Save" +msgstr "Speichern" + +#: revpioption.py:184 revpiplclist.py:115 +msgid "Close" +msgstr "Schließen" + +#: revpioption.py:230 revpioption.py:254 revpiplclist.py:151 +#: revpiplclist.py:176 revpiprogram.py:367 revpiprogram.py:420 +msgid "Question" +msgstr "Frage" + +#: revpioption.py:231 +msgid "" +"The settings are now saved on the Revolution Pi. \n" +"\n" +"Should the new settings take effect immediately? \n" +"This means a restart of the service and the PLC program!" +msgstr "" +"Die Einstellungen werden jetzt auf dem Revolution Pi gespeichert.\n" +"\n" +"Sollen die neuen Einstellungen sofort in Kraft treten?\n" +"Dies bedeutet einen Neustart des Dienstes und des laufenden PLC-Programms!" + +#: revpioption.py:239 revpiplclist.py:191 revpiprogram.py:65 +msgid "Information" +msgstr "Information" + +#: revpioption.py:240 +msgid "Settings saved" +msgstr "Einstellungen gespeichert" + +#: revpioption.py:245 revpiplclist.py:199 revpiprogram.py:307 +#: revpiprogram.py:336 revpiprogram.py:400 revpiprogram.py:435 +#: revpiprogram.py:520 revpiprogram.py:590 revpiprogram.py:620 +#: revpiprogram.py:632 revpiprogram.py:681 revpiprogram.py:702 +#: revpiprogram.py:711 revpipycontrol.py:308 +msgid "Error" +msgstr "Fehler" + +#: revpioption.py:246 +msgid "The settings could not be saved. This can happen if values are wrong!" +msgstr "" +"Die Einstellungen konnten nicht gesichert werden. Dies kann passieren, wenn " +"Werte falsch sind!" + +#: revpioption.py:255 +msgid "" +"Are you sure you want to deactivate the XML-RPC server? You will NOT be able " +"to access the Revolution Pi with this program." +msgstr "" +"Soll der XML-RPC Server wirklich beendet werden? Sie können dann NICHT mehr " +"mit diesem Programm auf den Revolution Pi zugreifen." + +#: revpiplclist.py:54 +msgid "RevPi Python PLC connections" +msgstr "RevPi Python PLC Verbindungen" + +#: revpiplclist.py:75 +msgid "Name" +msgstr "Name" + +#: revpiplclist.py:82 +msgid "IP address" +msgstr "IP Adresse" + +#: revpiplclist.py:90 +msgid "Port" +msgstr "Port" + +#: revpiplclist.py:99 +msgid "New" +msgstr "Neu" + +#: revpiplclist.py:102 +msgid "Apply" +msgstr "Übernehmen" + +#: revpiplclist.py:106 +msgid "Remove" +msgstr "Entfernen" + +#: revpiplclist.py:152 +msgid "" +"Do you really want to quit? \n" +"Unsaved changes will be lost" +msgstr "" +"Wollen Sie wirklich beenden? \n" +"Nicht gespeicherte Änderungen gehen verloren" + +#: revpiplclist.py:177 +msgid "Do you really want to delete the selected connection '{}'" +msgstr "Wollen Sie die ausgewählte Verbindung '{}' wirklich löschen?" + +#: revpiplclist.py:192 +msgid "" +"Successfully saved. \n" +"Do you want to close this window?" +msgstr "" +"Verbindungen erfolgreich gespeichert. \n" +"Möchten Sie dieses Fenster jetzt schließen?" + +#: revpiplclist.py:200 +msgid "Failed to save connections" +msgstr "Verbindungen konnten nicht gespeichert werden" + +#: revpiprogram.py:67 +msgid "" +"A PLC program has been uploaded. Please check the PLC options to see if the " +"correct program is specified as the start program." +msgstr "" +"Ein PLC Programm wurde hochgeladen. Bitte prüfen Sie die PLC Optionen, ob " +"dort das richtige Programm als Startprogramm angegeben ist." + +#: revpiprogram.py:75 +msgid "RevPi Python PLC program" +msgstr "RevPi Python PLC Programm" + +#: revpiprogram.py:89 +msgid "PLC python program" +msgstr "PLC Python Programm" + +#: revpiprogram.py:99 revpiprogram.py:101 revpiprogram.py:109 +#: revpiprogram.py:113 +msgid "Files" +msgstr "Dateien" + +#: revpiprogram.py:99 revpiprogram.py:101 revpiprogram.py:468 +#: revpiprogram.py:574 +msgid "Zip archive" +msgstr "Zip Archiv" + +#: revpiprogram.py:99 revpiprogram.py:101 revpiprogram.py:481 +#: revpiprogram.py:603 +msgid "TGZ archive" +msgstr "TGZ Archiv" + +#: revpiprogram.py:101 +msgid "Folder" +msgstr "Verzeichnis" + +#: revpiprogram.py:118 +msgid "Download PLC program as:" +msgstr "PLC Programm herunterladen als:" + +#: revpiprogram.py:128 +msgid "include piCtory configuration" +msgstr "inkl. piCtory Konfiguration" + +#: revpiprogram.py:133 revpiprogram.py:177 revpiprogram.py:198 +msgid "Download" +msgstr "Herunterladen" + +#: revpiprogram.py:138 +msgid "Upload PLC program as:" +msgstr "PLC Programm hochladen als:" + +#: revpiprogram.py:150 +msgid "clean upload folder before upload" +msgstr "vorher Inhalt im Uploadverzeichnis löschen" + +#: revpiprogram.py:157 +msgid "includes piCtory configuration" +msgstr "enthält piCtory Konfiguration" + +#: revpiprogram.py:163 revpiprogram.py:185 +msgid "Upload" +msgstr "Hochladen" + +#: revpiprogram.py:169 +msgid "piCtory configuration" +msgstr "piCtory Konfiguration" + +#: revpiprogram.py:173 +msgid "Download piCtory configuration" +msgstr "piCtory Konfiguration herunterladen" + +#: revpiprogram.py:180 +msgid "Upload piCtory configuration" +msgstr "piCtory Konfiguration hochladen" + +#: revpiprogram.py:191 +msgid "piControl0 prozess image" +msgstr "piControl0 Prozessabbild" + +#: revpiprogram.py:194 +msgid "Download process image dump" +msgstr "Prozessabbild Dump herunterladen" + +#: revpiprogram.py:204 +msgid "Reset piControl" +msgstr "piControl zurücksetzen" + +#: revpiprogram.py:207 +msgid "Execute piControlReset" +msgstr "piControlReset ausführen" + +#: revpiprogram.py:211 +msgid "execute" +msgstr "ausführen" + +#: revpiprogram.py:217 revpipycontrol.py:96 +msgid "Exit" +msgstr "Beenden" + +#: revpiprogram.py:297 revpiprogram.py:326 revpiprogram.py:464 +#: revpiprogram.py:477 +msgid "Save as..." +msgstr "Speichern unter..." + +#: revpiprogram.py:300 revpiprogram.py:359 +msgid "piCtory config" +msgstr "piCtory Konfiguration" + +#: revpiprogram.py:300 revpiprogram.py:329 revpiprogram.py:359 +#: revpiprogram.py:468 revpiprogram.py:481 revpiprogram.py:549 +#: revpiprogram.py:574 revpiprogram.py:603 +msgid "All files" +msgstr "Alle Dateien" + +#: revpiprogram.py:308 revpiprogram.py:337 revpiprogram.py:521 +msgid "Could not load and save file!" +msgstr "Datei konnte nicht geladen und gespeichert werden!" + +#: revpiprogram.py:312 revpiprogram.py:341 revpiprogram.py:379 +#: revpiprogram.py:388 revpiprogram.py:430 revpiprogram.py:525 +#: revpiprogram.py:672 +msgid "Success" +msgstr "Erfolgreich" + +#: revpiprogram.py:313 revpiprogram.py:342 revpiprogram.py:526 +msgid "File successfully loaded and saved." +msgstr "Dateien erfolgreich übertragen und gespeichert." + +#: revpiprogram.py:329 +msgid "Imagefiles" +msgstr "Image Dateien" + +#: revpiprogram.py:355 +msgid "Open piCtory file..." +msgstr "piCtory Datei öffnen" + +#: revpiprogram.py:369 +msgid "" +"Should the piControl driver be reset after uploading the piCtory " +"configuration?" +msgstr "" +"Soll nach dem Hochladen der piCtory Konfiguration ein Reset am piControl " +"Treiber durchgeführt werden?" + +#: revpiprogram.py:381 +msgid "" +"The transfer of the piCtory configuration and the reset of piControl have " +"been successfully executed" +msgstr "" +"Die Übertragung der piCtory Konfiguration und der Reset von piControl wurden " +"erfolgreich ausgeführt" + +#: revpiprogram.py:390 +msgid "The piCtory configuration was successfully transferred" +msgstr "Die Übertragung der piCtory Konfiguration wurde erfolgreich ausgeführt" + +#: revpiprogram.py:402 +msgid "The piCtory configuration could not be written on the Revolution Pi." +msgstr "" +"Die piCtory Konfiguration konnte auf dem Revolution Pi nicht geschrieben " +"werden." + +#: revpiprogram.py:408 revpipycontrol.py:199 revpipycontrol.py:247 +#: revpipycontrol.py:267 +msgid "Warning" +msgstr "Warnung" + +#: revpiprogram.py:410 +msgid "" +"The piCtroy configuration has been saved successfully. \n" +"An error occurred on piControl reset!" +msgstr "" +"Die piCtroy Konfiguration wurde erfolgreich gespeichert. \n" +"Beim piControl Reset trat allerdings ein Fehler auf!" + +#: revpiprogram.py:422 +msgid "" +"Are you sure to reset piControl? \n" +"The process image and the piBridge are interrupted !!!" +msgstr "" +"Soll piControlReset wirklich durchgeführt werden? \n" +"Das Prozessabbild und die Steuerung werden dann unterbrochen!!!" + +#: revpiprogram.py:431 +msgid "piControlReset executed successfully" +msgstr "piControl Reset war erfolgreich" + +#: revpiprogram.py:437 +msgid "piControl reset could not be executed successfully" +msgstr "piControl Reset konnte nicht erfolgreich durchgeführt werden" + +#: revpiprogram.py:451 +msgid "Directory to save" +msgstr "Verzeichnis zum Ablegen" + +#: revpiprogram.py:559 +msgid "Folder to upload" +msgstr "Verzeichnis zum Hochladen" + +#: revpiprogram.py:570 +msgid "Upload Zip archive..." +msgstr "Zip Archiv hochladen..." + +#: revpiprogram.py:591 +msgid "The specified file is not a ZIP archive." +msgstr "Die angegebene Datei ist kein ZIP Archiv" + +#: revpiprogram.py:599 +msgid "Upload TarGz archiv..." +msgstr "TarGz Archiv hochladen..." + +#: revpiprogram.py:621 +msgid "The specified file is not a TAR archive." +msgstr "Die angegebene Datei ist kein TAR Archiv." + +#: revpiprogram.py:634 +msgid "There was an error deleting the files on the Revolution Pi." +msgstr "" +"Beim Löschen der Dateien auf dem Revolution Pi ist ein Fehler aufgetreten." + +#: revpiprogram.py:673 +msgid "The transfer was successful." +msgstr "Die Übertragung war erfolgreich." + +#: revpiprogram.py:683 +msgid "There is no piCtory configuration in this archive." +msgstr "Es wurde keine piCtory Konfiguration im Archiv gefunden." + +#: revpiprogram.py:704 +msgid "The Revolution Pi could not process some parts of the transmission." +msgstr "Der Revoluton Pi konnte Teile der Übertragung nicht verarbeiten." + +#: revpiprogram.py:712 +msgid "Errors occurred during transmission" +msgstr "Bei der Übertragung traten Fehler auf" + +#: revpipycontrol.py:94 +msgid "Connections..." +msgstr "Verbindungen..." + +#: revpipycontrol.py:97 +msgid "Main" +msgstr "Datei" + +#: revpipycontrol.py:108 +msgid "PLC start" +msgstr "PLC Start" + +#: revpipycontrol.py:113 +msgid "PLC stop" +msgstr "PLC Stopp" + +#: revpipycontrol.py:118 +msgid "PLC restart" +msgstr "PLC Neustart" + +#: revpipycontrol.py:123 +msgid "PLC logs" +msgstr "PLC Logs" + +#: revpipycontrol.py:134 +msgid "PLC watch mode" +msgstr "PLC watch Modus" + +#: revpipycontrol.py:151 +msgid "PLC log..." +msgstr "PLC Log..." + +#: revpipycontrol.py:153 +msgid "PLC options..." +msgstr "PLC Optionen..." + +#: revpipycontrol.py:155 +msgid "PLC program..." +msgstr "PLC Programm..." + +#: revpipycontrol.py:159 +msgid "Disconnect" +msgstr "Trennen" + +#: revpipycontrol.py:164 +msgid "Connect" +msgstr "Verbinden" + +#: revpipycontrol.py:201 +msgid "" +"The watch mode ist not supported in version {} of RevPiPyLoad on your RevPi! " +"You need at least version 0.4.0." +msgstr "" +"Die Debug-Funktion wird von der RevPiPyLoad Version {} auf dem RevPi nicht " +"unterstützt! Sie benötigen mindestens Version 0.4.0." + +#: revpipycontrol.py:249 revpipycontrol.py:269 +msgid "" +"XML-RPC access mode in the RevPiPyLoad configuration is to small to access " +"this dialog" +msgstr "" +"Der XML-RPC Modus ist beim RevPiPyLoad nicht hoch genug eingestellt, um " +"diesen Dialog zu verwenden!" + +#: revpipycontrol.py:309 +msgid "Can not reach server!" +msgstr "Server ist nicht erreichbar!" diff --git a/revpipycontrol/mytools.py b/revpipycontrol/mytools.py index 858d53a..941b8c2 100644 --- a/revpipycontrol/mytools.py +++ b/revpipycontrol/mytools.py @@ -33,7 +33,7 @@ def gettrans(proglang=None): # Sprache auswählen if proglang is None: # Autodetect Language or switch to static - # proglang = "de" + # proglang = "en" proglang = locale.getdefaultlocale()[0].split('_')[0] # Übersetzungen laden diff --git a/revpipycontrol/revpicheckclient.py b/revpipycontrol/revpicheckclient.py index c15c6ad..ca6941a 100644 --- a/revpipycontrol/revpicheckclient.py +++ b/revpipycontrol/revpicheckclient.py @@ -10,8 +10,12 @@ import pickle import tkinter from threading import Lock +from mytools import gettrans from xmlrpc.client import ServerProxy, MultiCall +# Übersetzung laden +_ = gettrans() + class RevPiCheckClient(tkinter.Frame): @@ -136,7 +140,7 @@ class RevPiCheckClient(tkinter.Frame): """Erstellt den Fensterinhalt.""" devgrp = tkinter.LabelFrame(self) - devgrp["text"] = "Devices of RevPi" + devgrp["text"] = _("Devices of RevPi") devgrp.pack(fill="y", side="left") for dev in self.lst_devices: @@ -168,33 +172,33 @@ class RevPiCheckClient(tkinter.Frame): # Steuerungsfunktionen cntgrp = tkinter.LabelFrame(self) - cntgrp["text"] = "Control" + cntgrp["text"] = _("Control") cntgrp.pack(fill="y", side="right") self.btn_refresh = tkinter.Button(cntgrp) - self.btn_refresh["text"] = "Alle IOs lesen" + self.btn_refresh["text"] = _("Read all IOs") self.btn_refresh["command"] = self.refreshvalues self.btn_refresh.pack(fill="x") self.btn_read = tkinter.Button(cntgrp) - self.btn_read["text"] = "Inputs einlesen" + self.btn_read["text"] = _("Read just Inputs") self.btn_read["command"] = self.readvalues self.btn_read.pack(fill="x") self.btn_write = tkinter.Button(cntgrp) - self.btn_write["text"] = "Outputs schreiben" + self.btn_write["text"] = _("Write Outputs") self.btn_write["command"] = self.writevalues self.btn_write.pack(fill="x") check = tkinter.Checkbutton(cntgrp) check["command"] = self.toggleauto - check["text"] = "Autorefresh values" + check["text"] = _("Autorefresh values") check["variable"] = self.autorw check.pack(anchor="w") check = tkinter.Checkbutton(cntgrp) check["state"] = "disabled" if self.xmlmode < 3 else "normal" - check["text"] = "Write values to RevPi" + check["text"] = _("Write values to RevPi") check["variable"] = self.dowrite check.pack(anchor="w") diff --git a/revpipycontrol/revpilogfile.py b/revpipycontrol/revpilogfile.py index 0de9088..060ed49 100644 --- a/revpipycontrol/revpilogfile.py +++ b/revpipycontrol/revpilogfile.py @@ -7,6 +7,10 @@ # -*- coding: utf-8 -*- import pickle import tkinter +from mytools import gettrans + +# Übersetzung laden +_ = gettrans() class RevPiLogfile(tkinter.Frame): @@ -20,7 +24,7 @@ class RevPiLogfile(tkinter.Frame): self._createwidgets() def _createwidgets(self): - self.master.wm_title("RevPi Python PLC Logs") + self.master.wm_title(_("RevPi Python PLC Logs")) self.rowconfigure(0, weight=0) self.rowconfigure(1, weight=1) @@ -33,11 +37,11 @@ class RevPiLogfile(tkinter.Frame): # PLC Log self.lblapplog = tkinter.Label(self) - self.lblapplog["text"] = "RevPyPyLoad - Logfile" + self.lblapplog["text"] = _("RevPiPyLoad - Logfile") self.lblapplog.grid(column=0, row=0, sticky="w") self.btnapplog = tkinter.Button(self) self.btnapplog["command"] = self.btn_clearplc - self.btnapplog["text"] = "Clear screen" + self.btnapplog["text"] = _("Clear screen") self.btnapplog.grid(column=1, row=0, sticky="e") self.plclog = tkinter.Text(self) self.plcscr = tkinter.Scrollbar(self) @@ -48,11 +52,11 @@ class RevPiLogfile(tkinter.Frame): # APP Log self.lblapplog = tkinter.Label(self) - self.lblapplog["text"] = "Python PLC program - Logfile" + self.lblapplog["text"] = _("Python PLC program - Logfile") self.lblapplog.grid(column=3, row=0, sticky="w") self.btnapplog = tkinter.Button(self) self.btnapplog["command"] = self.btn_clearapp - self.btnapplog["text"] = "Clear screen" + self.btnapplog["text"] = _("Clear screen") self.btnapplog.grid(column=4, row=0, sticky="e") self.applog = tkinter.Text(self) self.appscr = tkinter.Scrollbar(self) diff --git a/revpipycontrol/revpioption.py b/revpipycontrol/revpioption.py index 68dce00..23a59f2 100644 --- a/revpipycontrol/revpioption.py +++ b/revpipycontrol/revpioption.py @@ -7,7 +7,10 @@ # -*- coding: utf-8 -*- import tkinter import tkinter.messagebox as tkmsg +from mytools import gettrans +# Übersetzung laden +_ = gettrans() class RevPiOption(tkinter.Frame): @@ -27,7 +30,7 @@ class RevPiOption(tkinter.Frame): self._loadappdata() def _createwidgets(self): - self.master.wm_title("RevPi Python PLC Options") + self.master.wm_title(_("RevPi Python PLC Options")) self.master.wm_resizable(width=False, height=False) cpadw = {"padx": 4, "pady": 2, "sticky": "w"} @@ -35,7 +38,7 @@ class RevPiOption(tkinter.Frame): # Gruppe Start/Stop stst = tkinter.LabelFrame(self) - stst["text"] = "Start / Stopp Verhalten" + stst["text"] = _("Start / Stop behavior") stst.grid(columnspan=2, pady=2, sticky="we") self.var_start = tkinter.BooleanVar(stst) @@ -44,34 +47,34 @@ class RevPiOption(tkinter.Frame): self.var_zerr = tkinter.BooleanVar(stst) ckb_start = tkinter.Checkbutton(stst) - ckb_start["text"] = "Programm automatisch starten" + ckb_start["text"] = _("Start program automatically") ckb_start["state"] = self.xmlstate ckb_start["variable"] = self.var_start ckb_start.grid(**cpadw) ckb_reload = tkinter.Checkbutton(stst) - ckb_reload["text"] = "Programm nach Beenden neu starten" + ckb_reload["text"] = _("Restart program after exit") ckb_reload["state"] = self.xmlstate ckb_reload["variable"] = self.var_reload ckb_reload.grid(**cpadw) ckb_zexit = tkinter.Checkbutton(stst, justify="left") ckb_zexit["state"] = self.xmlstate - ckb_zexit["text"] = "Prozessabbild auf NULL setzen, wenn " \ - "Programm\nerfolgreich beendet wird" + ckb_zexit["text"] = _("Set process image to NULL if program\n" + "terminates successfully") ckb_zexit["variable"] = self.var_zexit ckb_zexit.grid(**cpadw) ckb_zerr = tkinter.Checkbutton(stst, justify="left") ckb_zerr["state"] = self.xmlstate - ckb_zerr["text"] = "Prozessabbild auf NULL setzen, wenn " \ - "Programm\ndurch Absturz beendet wird" + ckb_zerr["text"] = _("Set process image to NULL if program\n" + "terminates with errors") ckb_zerr["variable"] = self.var_zerr ckb_zerr.grid(**cpadw) # Gruppe Programm prog = tkinter.LabelFrame(self) - prog["text"] = "PLC Programm" + prog["text"] = _("PLC program") prog.grid(columnspan=2, pady=2, sticky="we") self.var_pythonver = tkinter.IntVar(prog) @@ -82,7 +85,7 @@ class RevPiOption(tkinter.Frame): self.var_pythonver.set(3) lbl = tkinter.Label(prog) - lbl["text"] = "Python Version" + lbl["text"] = _("Python version") lbl.grid(columnspan=2, row=0, **cpadw) rbn = tkinter.Radiobutton(prog) rbn["state"] = self.xmlstate @@ -99,7 +102,7 @@ class RevPiOption(tkinter.Frame): rbn.grid(column=1, row=1, **cpadw) lbl = tkinter.Label(prog) - lbl["text"] = "Python PLC Programname" + lbl["text"] = _("Python PLC program name") lbl.grid(columnspan=2, **cpadw) lst = self.xmlcli.get_filelist() @@ -111,7 +114,7 @@ class RevPiOption(tkinter.Frame): opt_startpy.grid(columnspan=2, **cpadwe) lbl = tkinter.Label(prog) - lbl["text"] = "Programm Argumente" + lbl["text"] = _("Program arguments") lbl.grid(columnspan=2, **cpadw) txt = tkinter.Entry(prog) @@ -120,14 +123,14 @@ class RevPiOption(tkinter.Frame): ckb_slave = tkinter.Checkbutton(prog, justify="left") ckb_slave["state"] = self.xmlstate - ckb_slave["text"] = "RevPi als PLC-Slave verwenden" + ckb_slave["text"] = _("Use RevPi as PLC-Slave") ckb_slave["state"] = "disabled" ckb_slave["variable"] = self.var_slave ckb_slave.grid(columnspan=2, **cpadw) # Gruppe XMLRPC xmlrpc = tkinter.LabelFrame(self) - xmlrpc["text"] = "XML-RPC Server" + xmlrpc["text"] = _("XML-RPC server") xmlrpc.grid(columnspan=2, pady=2, sticky="we") self.var_xmlon = tkinter.BooleanVar(xmlrpc) @@ -139,7 +142,7 @@ class RevPiOption(tkinter.Frame): ckb_xmlon = tkinter.Checkbutton(xmlrpc) ckb_xmlon["command"] = self.askxmlon ckb_xmlon["state"] = self.xmlstate - ckb_xmlon["text"] = "XML-RPC Server aktiv auf RevPi" + ckb_xmlon["text"] = _("Activate XML-RPC server on RevPi") ckb_xmlon["variable"] = self.var_xmlon ckb_xmlon.grid(**cpadw) @@ -147,19 +150,19 @@ class RevPiOption(tkinter.Frame): self.ckb_xmlmod2["command"] = self.xmlmods self.ckb_xmlmod2["state"] = self.xmlstate self.ckb_xmlmod2["text"] = \ - "Download von piCtory Konfiguration und\nPLC Programm zulassen" + _("Allow download of piCtory configuration and\nPLC programm") self.ckb_xmlmod2["variable"] = self.var_xmlmod2 self.ckb_xmlmod2.grid(**cpadw) self.ckb_xmlmod3 = tkinter.Checkbutton(xmlrpc, justify="left") self.ckb_xmlmod3["state"] = self.xmlstate self.ckb_xmlmod3["text"] = \ - "Upload von piCtory Konfiguration und\nPLC Programm zualssen" + _("Allow upload of piCtory configuration and\nPLC programm") self.ckb_xmlmod3["variable"] = self.var_xmlmod3 self.ckb_xmlmod3.grid(**cpadw) lbl = tkinter.Label(xmlrpc) - lbl["text"] = "XML-RPC Serverport" + lbl["text"] = _("XML-RPC server port") lbl.grid(**cpadw) spb_xmlport = tkinter.Spinbox(xmlrpc) @@ -173,12 +176,12 @@ class RevPiOption(tkinter.Frame): btn_save = tkinter.Button(self) btn_save["command"] = self._setappdata btn_save["state"] = self.xmlstate - btn_save["text"] = "Speichern" + btn_save["text"] = _("Save") btn_save.grid(column=0, row=3) btn_close = tkinter.Button(self) btn_close["command"] = self.master.destroy - btn_close["text"] = "Schließen" + btn_close["text"] = _("Close") btn_close.grid(column=1, row=3) def _loadappdata(self): @@ -224,30 +227,35 @@ class RevPiOption(tkinter.Frame): self.xmlmode = dc["xmlrpc"] ask = tkmsg.askyesnocancel( - "Frage", "Die Einstellungen werden jetzt auf dem Revolution Pi " - "gespeichert. \n\nSollen die neuen Einstellungen sofort in Kraft " - "treten? \nDies bedeutet einen Neustart des Dienstes und des ggf. " - "laufenden PLC-Programms!", parent=self.master + _("Question"), + _("The settings are now saved on the Revolution Pi. \n\n" + "Should the new settings take effect immediately? \nThis " + "means a restart of the service and the PLC program!"), + parent=self.master ) if ask is not None: if self.xmlcli.set_config(dc, ask): tkmsg.showinfo( - "Information", "Einstellungen gespeichert.", + _("Information"), + _("Settings saved"), parent=self.master ) else: tkmsg.showerror( - "Fehler", "Die Einstellungen konnten nicht gesichert" - "werden. Dies kann passieren, wenn Werte falsch sind!", + _("Error"), + _("The settings could not be saved. This can happen if " + "values are wrong!"), parent=self.master ) def askxmlon(self): if not self.var_xmlon.get(): ask = tkmsg.askyesno( - "Frage", "Soll der XML-RPC Server wirklich beendet werden? " - "Sie können dann NICHT mehr mit diesem Programm auf den " - "Revolution Pi zugreifen.", parent=self.master + _("Question"), + _("Are you sure you want to deactivate the XML-RPC server? " + "You will NOT be able to access the Revolution Pi with " + "this program."), + parent=self.master ) if not ask: self.var_xmlon.set(True) diff --git a/revpipycontrol/revpiplclist.py b/revpipycontrol/revpiplclist.py index db7a039..801b845 100644 --- a/revpipycontrol/revpiplclist.py +++ b/revpipycontrol/revpiplclist.py @@ -9,10 +9,14 @@ import os.path import pickle import tkinter import tkinter.messagebox as tkmsg +from mytools import gettrans from os import environ from os import makedirs from sys import platform +# Übersetzungen laden +_ = gettrans() + # Systemwerte if platform == "linux": homedir = environ["HOME"] @@ -47,8 +51,9 @@ class RevPiPlcList(tkinter.Frame): self._loadappdata() def _createwidgets(self): - self.master.wm_title("RevPi Python PLC Connections") + self.master.wm_title(_("RevPi Python PLC connections")) self.master.wm_resizable(width=False, height=False) + self.master.protocol("WM_DELETE_WINDOW", self.evt_btnclose) # Listbox mit vorhandenen Verbindungen self.scr_conn = tkinter.Scrollbar(self) @@ -66,14 +71,14 @@ class RevPiPlcList(tkinter.Frame): self.var_port.set("55123") # Eingabefelder für Adresse und Namen - tkinter.Label(self, text="Name").grid( + tkinter.Label(self, text=_("Name")).grid( column=2, row=0, sticky="wn", padx=5, pady=5) self.txt_name = tkinter.Entry(self, textvariable=self.var_name) self.txt_name.bind("", self.evt_keypress) self.txt_name.grid( column=3, row=0, columnspan=3, sticky="n", padx=5, pady=5) - tkinter.Label(self, text="IP-Adresse").grid( + tkinter.Label(self, text=_("IP address")).grid( column=2, row=1, sticky="wn", padx=5, pady=5 ) self.txt_address = tkinter.Entry(self, textvariable=self.var_address) @@ -81,7 +86,7 @@ class RevPiPlcList(tkinter.Frame): self.txt_address.grid( column=3, row=1, columnspan=3, sticky="n", padx=5, pady=5) - tkinter.Label(self, text="Port").grid( + tkinter.Label(self, text=_("Port")).grid( column=2, row=2, sticky="wn", padx=5, pady=5) self.txt_port = tkinter.Entry(self, textvariable=self.var_port) self.txt_port.bind("", self.evt_keypress) @@ -90,23 +95,23 @@ class RevPiPlcList(tkinter.Frame): # Listenbutton self.btn_new = tkinter.Button( - self, text="Neu", command=self.evt_btnnew) + self, text=_("New"), command=self.evt_btnnew) self.btn_new.grid(column=2, row=3, sticky="s") self.btn_add = tkinter.Button( - self, text="Übernehmen", command=self.evt_btnadd, + self, text=_("Apply"), command=self.evt_btnadd, state="disabled") self.btn_add.grid(column=3, row=3, sticky="s") self.btn_remove = tkinter.Button( - self, text="Entfernen", command=self.evt_btnremove, + self, text=_("Remove"), command=self.evt_btnremove, state="disabled") self.btn_remove.grid(column=4, row=3, sticky="s") # Fensterbuttons self.btn_save = tkinter.Button( - self, text="Speichern", command=self.evt_btnsave) + self, text=_("Save"), command=self.evt_btnsave) self.btn_save.grid(column=3, row=9, sticky="se") self.btn_close = tkinter.Button( - self, text="Schließen", command=self.evt_btnclose) + self, text=_("Close"), command=self.evt_btnclose) self.btn_close.grid(column=4, row=9, sticky="se") def _loadappdata(self): @@ -142,9 +147,10 @@ class RevPiPlcList(tkinter.Frame): def evt_btnclose(self): if self.changes: ask = tkmsg.askyesno( - parent=self.master, title="Frage...", - message="Wollen Sie wirklich beenden?\n" - "Nicht gespeicherte Änderungen gehen verloren", + _("Question"), + _("Do you really want to quit? \nUnsaved changes will " + "be lost"), + parent=self.master ) else: ask = True @@ -166,9 +172,9 @@ class RevPiPlcList(tkinter.Frame): if len(item_index) == 1: item = self.list_conn.get(item_index[0]) ask = tkmsg.askyesno( - "Frage", - "Wollen Sie die Ausgewählte Verbindung '{}' wirklich " - "löschen?".format(item), + _("Question"), + _("Do you really want to delete the selected connection '{}'" + "").format(item), parent=self.master ) if ask: @@ -181,15 +187,16 @@ class RevPiPlcList(tkinter.Frame): def evt_btnsave(self): if self._saveappdata(): ask = tkmsg.askyesno( - "Information", "Verbindungen erfolgreich gespeichert.\n" - "Möchten Sie dieses Fenster jetzt schließen?", + _("Information"), + _("Successfully saved. \nDo you want to close this window?"), parent=self.master ) if ask: self.master.destroy() else: tkmsg.showerror( - "Fehler", "Verbindungen konnten nicht gespeichert werden", + _("Error"), + _("Failed to save connections"), parent=self.master ) diff --git a/revpipycontrol/revpiprogram.py b/revpipycontrol/revpiprogram.py index 96d733e..1e6df5e 100644 --- a/revpipycontrol/revpiprogram.py +++ b/revpipycontrol/revpiprogram.py @@ -62,17 +62,18 @@ class RevPiProgram(tkinter.Frame): def _checkclose(self): if True or self.uploaded: tkmsg.showinfo( - parent=self.master, title=_("Information"), - message=_( + _("Information"), + _( "A PLC program has been uploaded. Please check the " "PLC options to see if the correct program is specified " "as the start program." - ) + ), + parent=self.master ) self.master.destroy() def _createwidgets(self): - self.master.wm_title(_("RevPi python PLC programm")) + self.master.wm_title(_("RevPi Python PLC program")) self.master.wm_resizable(width=False, height=False) self.rowconfigure(0, weight=1) @@ -86,7 +87,7 @@ class RevPiProgram(tkinter.Frame): # Gruppe Programm prog = tkinter.LabelFrame(self) prog.columnconfigure(0, weight=1) - prog["text"] = _("PLC python programm") + prog["text"] = _("PLC python program") prog.grid(columnspan=2, pady=2, sticky="we") # Variablen vorbereiten @@ -297,7 +298,7 @@ class RevPiProgram(tkinter.Frame): title=_("Save as..."), initialdir=self.opt.get("getpictoryrsc_dir", ""), initialfile=self.revpi + ".rsc", - filetypes=((_("piCtory Config"), "*.rsc"), (_("All files"), "*.*")) + filetypes=((_("piCtory config"), "*.rsc"), (_("All files"), "*.*")) ) if fh is not None: try: diff --git a/revpipycontrol/revpipycontrol.py b/revpipycontrol/revpipycontrol.py index dd131cf..241b634 100755 --- a/revpipycontrol/revpipycontrol.py +++ b/revpipycontrol/revpipycontrol.py @@ -244,11 +244,12 @@ class RevPiPyControl(tkinter.Frame): u"""Startet das Optionsfenster.""" if self.xmlmode < 2: tkmsg.showwarning( - parent=self.master, title="Warnung", - message=_( + _("Warning"), + _( "XML-RPC access mode in the RevPiPyLoad " "configuration is to small to access this dialog" - ) + ), + parent=self.master ) else: win = tkinter.Toplevel(self) @@ -263,11 +264,12 @@ class RevPiPyControl(tkinter.Frame): u"""Startet das Programmfenster.""" if self.xmlmode < 2: tkmsg.showwarning( - parent=self.master, title="Warnung", - message=_( + _("Warning"), + _( "XML-RPC access mode in the RevPiPyLoad " "configuration is to small to access this dialog" - ) + ), + parent=self.master ) else: win = tkinter.Toplevel(self) @@ -302,20 +304,24 @@ class RevPiPyControl(tkinter.Frame): def servererror(self): u"""Setzt alles zurück für neue Verbindungen.""" self.serverdisconnect() - tkmsg.showerror(_("Fehler"), _("Server ist nicht erreichbar!")) + tkmsg.showerror( + _("Error"), + _("Can not reach server!"), + parent=self.master + ) def tmr_plcrunning(self): self._btnstate() if self.cli is None: self.txt_status["readonlybackground"] = "lightblue" - self.var_status.set(_("NOT CONNECTED")) + self.var_status.set("NOT CONNECTED") else: try: plcec = self.cli.plcexitcode() except: self.errcount += 1 if self.errcount >= 5: - self.var_status.set(_("SERVER ERROR")) + self.var_status.set("SERVER ERROR") self.servererror() else: self.errcount = 0 @@ -323,17 +329,17 @@ class RevPiPyControl(tkinter.Frame): "green" if plcec == -1 else "red" if plcec == -1: - plcec = _("RUNNING") + plcec = "RUNNING" elif plcec == -2: - plcec = _("FILE NOT FOUND") + plcec = "FILE NOT FOUND" elif plcec == -3: - plcec = _("NOT RUNNING (NO STATUS)") + plcec = "NOT RUNNING (NO STATUS)" elif plcec == -9: - plcec = _("PROGRAM KILLED") + plcec = "PROGRAM KILLED" elif plcec == -15: - plcec = _("PROGRAM TERMED") + plcec = "PROGRAM TERMED" elif plcec == 0: - plcec = _("NOT RUNNING") + plcec = "NOT RUNNING" self.var_status.set(plcec) self.master.after(1000, self.tmr_plcrunning)