Add gettext i18n to pronterface

master
Jonathan Marsden 2011-08-06 16:45:52 -07:00
parent df051e600f
commit c2649a291f
5 changed files with 1303 additions and 145 deletions

43
README.i18n Normal file
View File

@ -0,0 +1,43 @@
Printrun Internationalization
Date: 06 August 2011
Author: Jonathan Marsden <jmarsden@.fastmail.fm>
Printrun is in the very early stages of being internationalized.
The pronterface.py now uses gettext for the messages it generates.
The corresponding pronterface.pot file is at locale/pronterface.pot
and was generated using
pygettext -o locale/pronterface.pot pronterface.py
followed by minor edits to the generated header.
This template is the basis for all pronterface mesage catalogs. Right
now there is only one, for German. New ones can be created:
# Create new pronterface message catalog for a different language
newlang="es" # use the correct code for your language
mkdir -p locale/${newlang}/LC_MESSAGES
cp locale/pronterface.pot locale/${newlanguage}/LC_MESSAGES/${newlang}.po
cd locale/${newlanguage}/LC_MESSAGES/${newlang}
# Edit the .po file to add messages for newlang
msgfmt -o ${newlang}.mo ${newlang}.po
As currently coded, the default location for these message catalogs is
/usr/share/pronterface/locale/
So, to install the catalogs, copy them to there:
sudo cp -a locale /usr/share/pronterface/
To test pronterface in a new language, you can temporarily set LANG to
the language you are testing, for example
LANG=de python pronterface.py
Further automation for localization and packaging of Printrun would be
nice to see, but is not here yet.

BIN
locale/de/LC_MESSAGES/de.mo Normal file

Binary file not shown.

554
locale/de/LC_MESSAGES/de.po Normal file
View File

@ -0,0 +1,554 @@
# Pronterface
# Copyright (C) 2011 Jonathan Marsden
# Jonathan Marsden <jmarsden@fastmail.fm>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: Pronterface jm1\n"
"POT-Creation-Date: 2011-08-06 13:27+PDT\n"
"PO-Revision-Date: 2011-08-06 13:27+PDT\n"
"Last-Translator: Jonathan Marsden <jmarsden@fastmail.fm>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: UTF-8\n"
"Generated-By: pygettext.py 1.5\n"
#: pronterface.py:10
msgid "WX is not installed. This program requires WX to run."
msgstr "WX ist nicht installiert. Dieses Programm erfordert WX zu laufen."
#: pronterface.py:55
msgid "Printer Interface"
msgstr "Druckerschnittstelle"
#: pronterface.py:67
msgid "X+100"
msgstr ""
#: pronterface.py:68
msgid "X+10"
msgstr ""
#: pronterface.py:69
msgid "X+1"
msgstr ""
#: pronterface.py:70
msgid "X+0.1"
msgstr ""
#: pronterface.py:71
msgid "HomeX"
msgstr "XHeimkehren"
#: pronterface.py:72
msgid "X-0.1"
msgstr ""
#: pronterface.py:73
msgid "X-1"
msgstr ""
#: pronterface.py:74
msgid "X-10"
msgstr ""
#: pronterface.py:75
msgid "X-100"
msgstr ""
#: pronterface.py:76
msgid "Y+100"
msgstr ""
#: pronterface.py:77
msgid "Y+10"
msgstr ""
#: pronterface.py:78
msgid "Y+1"
msgstr ""
#: pronterface.py:79
msgid "Y+0.1"
msgstr ""
#: pronterface.py:80
msgid "HomeY"
msgstr "YHeimkehren"
#: pronterface.py:81
msgid "Y-0.1"
msgstr ""
#: pronterface.py:82
msgid "Y-1"
msgstr ""
#: pronterface.py:83
msgid "Y-10"
msgstr ""
#: pronterface.py:84
msgid "Y-100"
msgstr ""
#: pronterface.py:85
msgid "Motors off"
msgstr "Motoren aus"
#: pronterface.py:86
msgid "Z+10"
msgstr ""
#: pronterface.py:87
msgid "Z+1"
msgstr ""
#: pronterface.py:88
msgid "Z+0.1"
msgstr ""
#: pronterface.py:89
msgid "HomeZ"
msgstr "ZHeimkehren"
#: pronterface.py:90
msgid "Z-0.1"
msgstr ""
#: pronterface.py:91
msgid "Z-1"
msgstr ""
#: pronterface.py:92
msgid "Z-10"
msgstr ""
#: pronterface.py:93
msgid "Home"
msgstr "Heimkehren"
#: pronterface.py:94
msgid "Check temp"
msgstr "Temperatur prüfen"
#: pronterface.py:95
msgid "Extrude"
msgstr ""
#: pronterface.py:96
msgid "Reverse"
msgstr "Umkehren"
#: pronterface.py:112
msgid ""
"# I moved all your custom buttons into .pronsolerc.\n"
"# Please don't add them here any more.\n"
"# Backup of your old buttons is in custombtn.old\n"
msgstr ""
#: pronterface.py:117
msgid "Note!!! You have specified custom buttons in both custombtn.txt and .pronsolerc"
msgstr "Beachten! Sie haben benutzerdefinierte Schaltflächen in custombtn.txt und .pronsolerc angegeben"
#: pronterface.py:118
msgid "Ignoring custombtn.txt. Remove all current buttons to revert to custombtn.txt"
msgstr "Ignorieren custombtn.txt. Zur Nutzung custombtn.txt wieder entfernen alle gängigen Tasten"
#: pronterface.py:141 pronterface.py:427 pronterface.py:956
#: pronterface.py:1003 pronterface.py:1113 pronterface.py:1140
#: pronterface.py:1154
msgid "Print"
msgstr "Drucken"
#: pronterface.py:145
msgid "Printer is now online"
msgstr "Drucker wird jetzt online"
#: pronterface.py:194
msgid "Setting hotend temperature to "
msgstr "Einstellen hotend Temperatur auf "
#: pronterface.py:194 pronterface.py:215
msgid " degrees Celsius."
msgstr " Grad Celsius."
#: pronterface.py:198 pronterface.py:219
msgid "Printer is not online."
msgstr "Drucker wird nicht online."
#: pronterface.py:200
msgid "You cannot set negative temperatures. To turn the hotend off entirely, set its temperature to 0."
msgstr "Sie können keine negativen Temperaturen einstellen. Um den hotend ganz auszushalten, einstellen Sie die Temperatur auf 0"
#: pronterface.py:202 pronterface.py:223
msgid "You must enter a temperature."
msgstr "Sie müssen eine Temperatur eingeben."
#: pronterface.py:215
msgid "Setting bed temperature to "
msgstr "Bett-Temperatur eingestellt: "
#: pronterface.py:221
msgid "You cannot set negative temperatures. To turn the bed off entirely, set its temperature to 0."
msgstr "Sie können keine negativen Temperaturen einstellen. Um den Bett ganz auszushalten, einstellen Sie die Temperatur auf 0"
#: pronterface.py:238
msgid "Do you want to erase the macro?"
msgstr "Möchten Sie das Makro löschen?"
#: pronterface.py:242
msgid "Cancelled."
msgstr "Abgesagt."
#: pronterface.py:271
msgid " Opens file"
msgstr " Öffnet eine Datei"
#: pronterface.py:271
msgid "&Open..."
msgstr "&Öffnen..."
#: pronterface.py:272
msgid " Edit open file"
msgstr " Datei bearbeiten"
#: pronterface.py:272
msgid "&Edit..."
msgstr "&Bearbeiten..."
#: pronterface.py:274
msgid " Adjust SFACT settings"
msgstr " SFACT Einstellungen anpassen"
#: pronterface.py:274
msgid "SFACT Settings"
msgstr "SFACT Einstellungen"
#: pronterface.py:277
msgid " Quickly adjust SFACT settings for active profile"
msgstr " SFACT Einstellungen für aktive Profil schnell anpassen"
#: pronterface.py:277
msgid "SFACT Quick Settings"
msgstr "SFACT schnelle Einstellungen"
#: pronterface.py:281
msgid " Closes the Window"
msgstr " schließt das Fenster"
#: pronterface.py:281
msgid "E&xit"
msgstr "Verlassen"
#: pronterface.py:282
msgid "&Print"
msgstr "&Drucken"
#: pronterface.py:285
msgid "&Macros"
msgstr "&Makros"
#: pronterface.py:286
msgid "<&New...>"
msgstr "<&Neu...>"
#: pronterface.py:287
msgid " Options dialog"
msgstr " Optionen-Dialog"
#: pronterface.py:287
msgid "&Options"
msgstr "&Optionen"
#: pronterface.py:288
msgid "&Settings"
msgstr "&Einstellungen"
#: pronterface.py:304
msgid "Enter macro name"
msgstr "Makro name eingeben"
#: pronterface.py:307
msgid "Macro name:"
msgstr "Makro name:"
#: pronterface.py:310
msgid "Ok"
msgstr ""
#: pronterface.py:314
msgid "Cancel"
msgstr "Absagen"
#: pronterface.py:332
msgid "' is being used by built-in command"
msgstr ""
#: pronterface.py:332
msgid "Name '"
msgstr ""
#: pronterface.py:368
msgid "Port:"
msgstr ""
#: pronterface.py:390
msgid "Connect"
msgstr "Verbinden"
#: pronterface.py:392
msgid "Connect to the printer"
msgstr "Drucker Verbinden"
#: pronterface.py:394
msgid "Disconnect"
msgstr "Trennen"
#: pronterface.py:398
msgid "Reset"
msgstr "Zurücksetzen"
#: pronterface.py:401 pronterface.py:579
msgid "Mini mode"
msgstr "Mini-Modus"
#: pronterface.py:407
msgid "Monitor\nprinter"
msgstr "Drucker\nüberwachen"
#: pronterface.py:416
msgid "Load file"
msgstr "Datei laden"
#: pronterface.py:419
msgid "SD Upload"
msgstr "SD hochladen"
#: pronterface.py:423
msgid "SD Print"
msgstr "SD Drucken"
#: pronterface.py:431 pronterface.py:1004 pronterface.py:1040
#: pronterface.py:1088 pronterface.py:1112 pronterface.py:1139
#: pronterface.py:1153
msgid "Pause"
msgstr ""
#: pronterface.py:445
msgid "Send"
msgstr "Senden"
#: pronterface.py:453 pronterface.py:511
msgid "mm/min"
msgstr ""
#: pronterface.py:455
msgid "XY:"
msgstr ""
#: pronterface.py:457
msgid "Z:"
msgstr ""
#: pronterface.py:474
msgid "Heater:"
msgstr "Heizung:"
#: pronterface.py:482 pronterface.py:494
msgid "Set"
msgstr ""
#: pronterface.py:486
msgid "Bed:"
msgstr "Bett"
#: pronterface.py:505
msgid "mm"
msgstr ""
#: pronterface.py:538 pronterface.py:833 pronterface.py:1034
msgid "Not connected to printer."
msgstr "Keine Verbindung zum Drucker."
#: pronterface.py:586
msgid "Full mode"
msgstr "voll-Modus"
#: pronterface.py:624
msgid "Defines custom button. Usage: button <num> \"title\" [/c \"colour\"] command"
msgstr ""
#: pronterface.py:646
msgid "Custom button number should be between 0 and 63"
msgstr ""
#: pronterface.py:736
msgid "Edit custom button '%s'"
msgstr ""
#: pronterface.py:738
msgid "Move left <<"
msgstr ""
#: pronterface.py:741
msgid "Move right >>"
msgstr ""
#: pronterface.py:745
msgid "Remove custom button '%s'"
msgstr ""
#: pronterface.py:748
msgid "Add custom button"
msgstr ""
#: pronterface.py:763
msgid "event object missing"
msgstr ""
#: pronterface.py:791
msgid "Invalid period given."
msgstr ""
#: pronterface.py:794
msgid "Monitoring printer."
msgstr ""
#: pronterface.py:796
msgid "Done monitoring."
msgstr ""
#: pronterface.py:815
msgid "Printer is online. "
msgstr ""
#: pronterface.py:817 pronterface.py:954 pronterface.py:1002
msgid "Loaded "
msgstr ""
#: pronterface.py:820
msgid "Bed"
msgstr "Bett"
#: pronterface.py:820
msgid "Hotend"
msgstr ""
#: pronterface.py:823
msgid " SD printing:%04.2f %%"
msgstr ""
#: pronterface.py:825
msgid " Printing:%04.2f %%"
msgstr ""
#: pronterface.py:879
msgid "Opening file failed."
msgstr ""
#: pronterface.py:885
msgid "Starting print"
msgstr ""
#: pronterface.py:908
msgid "Pick SD file"
msgstr ""
#: pronterface.py:908
msgid "Select the file to print"
msgstr ""
#: pronterface.py:936
msgid "Skeinforge execution failed."
msgstr ""
#: pronterface.py:943
msgid "Skeining..."
msgstr ""
#: pronterface.py:954 pronterface.py:1002
msgid ", %d lines"
msgstr ""
#: pronterface.py:963
msgid "Skeining "
msgstr ""
#: pronterface.py:965
msgid ""
"Skeinforge not found. \n"
"Please copy Skeinforge into a directory named \"skeinforge\" in the same directory as this file."
msgstr ""
#: pronterface.py:984
msgid "Open file to print"
msgstr "Zu druckenden Datei öffnen"
#: pronterface.py:985
msgid "STL and GCODE files (;*.gcode;*.g;*.stl;*.STL;)"
msgstr ""
#: pronterface.py:992
msgid "File not found!"
msgstr ""
#: pronterface.py:1011
msgid "mm of filament used in this print"
msgstr ""
#: pronterface.py:1031
msgid "No file loaded. Please use load first."
msgstr ""
#: pronterface.py:1042
msgid "Restart"
msgstr "Neustart"
#: pronterface.py:1046
msgid "File upload complete"
msgstr ""
#: pronterface.py:1065
msgid "Pick SD filename"
msgstr ""
#: pronterface.py:1081
msgid "Resume"
msgstr ""
#: pronterface.py:1147
msgid "Are you sure you want to reset the printer?"
msgstr "Möchten Sie wirklich, der Drucker Zurückzusetzen?"
#: pronterface.py:1147
msgid "Reset?"
msgstr "Zurücksetzen?"
#: pronterface.py:1226
msgid "Edit settings"
msgstr "Einstellungen bearbeiten"
#: pronterface.py:1228
msgid "Defaults"
msgstr "Standardwerte"
#: pronterface.py:1250
msgid "Custom button"
msgstr ""
#: pronterface.py:1258
msgid "Button title"
msgstr ""
#: pronterface.py:1261
msgid "Command"
msgstr ""
#: pronterface.py:1270
msgid "Color"
msgstr "Farbe"

556
locale/pronterface.pot Normal file
View File

@ -0,0 +1,556 @@
# Pronterface Message Catalog Template
# Copyright (C) 2011 Jonathan Marsden
# Jonathan Marsden <jmarsden@fastmail.fm>, 2011.
#
msgid ""
msgstr ""
"Project-Id-Version: Pronterface jm1\n"
"POT-Creation-Date: 2011-08-06 13:27+PDT\n"
"PO-Revision-Date: 2011-08-06 13:27+PDT\n"
"Last-Translator: Jonathan Marsden <jmarsden@fastmail.fm>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: UTF-8\n"
"Generated-By: pygettext.py 1.5\n"
#: pronterface.py:10
msgid "WX is not installed. This program requires WX to run."
msgstr ""
#: pronterface.py:55
msgid "Printer Interface"
msgstr ""
#: pronterface.py:67
msgid "X+100"
msgstr ""
#: pronterface.py:68
msgid "X+10"
msgstr ""
#: pronterface.py:69
msgid "X+1"
msgstr ""
#: pronterface.py:70
msgid "X+0.1"
msgstr ""
#: pronterface.py:71
msgid "HomeX"
msgstr ""
#: pronterface.py:72
msgid "X-0.1"
msgstr ""
#: pronterface.py:73
msgid "X-1"
msgstr ""
#: pronterface.py:74
msgid "X-10"
msgstr ""
#: pronterface.py:75
msgid "X-100"
msgstr ""
#: pronterface.py:76
msgid "Y+100"
msgstr ""
#: pronterface.py:77
msgid "Y+10"
msgstr ""
#: pronterface.py:78
msgid "Y+1"
msgstr ""
#: pronterface.py:79
msgid "Y+0.1"
msgstr ""
#: pronterface.py:80
msgid "HomeY"
msgstr ""
#: pronterface.py:81
msgid "Y-0.1"
msgstr ""
#: pronterface.py:82
msgid "Y-1"
msgstr ""
#: pronterface.py:83
msgid "Y-10"
msgstr ""
#: pronterface.py:84
msgid "Y-100"
msgstr ""
#: pronterface.py:85
msgid "Motors off"
msgstr ""
#: pronterface.py:86
msgid "Z+10"
msgstr ""
#: pronterface.py:87
msgid "Z+1"
msgstr ""
#: pronterface.py:88
msgid "Z+0.1"
msgstr ""
#: pronterface.py:89
msgid "HomeZ"
msgstr ""
#: pronterface.py:90
msgid "Z-0.1"
msgstr ""
#: pronterface.py:91
msgid "Z-1"
msgstr ""
#: pronterface.py:92
msgid "Z-10"
msgstr ""
#: pronterface.py:93
msgid "Home"
msgstr ""
#: pronterface.py:94
msgid "Check temp"
msgstr ""
#: pronterface.py:95
msgid "Extrude"
msgstr ""
#: pronterface.py:96
msgid "Reverse"
msgstr ""
#: pronterface.py:112
msgid ""
"# I moved all your custom buttons into .pronsolerc.\n"
"# Please don't add them here any more.\n"
"# Backup of your old buttons is in custombtn.old\n"
msgstr ""
#: pronterface.py:117
msgid "Note!!! You have specified custom buttons in both custombtn.txt and .pronsolerc"
msgstr ""
#: pronterface.py:118
msgid "Ignoring custombtn.txt. Remove all current buttons to revert to custombtn.txt"
msgstr ""
#: pronterface.py:141 pronterface.py:427 pronterface.py:956
#: pronterface.py:1003 pronterface.py:1113 pronterface.py:1140
#: pronterface.py:1154
msgid "Print"
msgstr ""
#: pronterface.py:145
msgid "Printer is now online"
msgstr ""
#: pronterface.py:194
msgid "Setting hotend temperature to "
msgstr ""
#: pronterface.py:194 pronterface.py:215
msgid " degrees Celsius."
msgstr ""
#: pronterface.py:198 pronterface.py:219
msgid "Printer is not online."
msgstr ""
#: pronterface.py:200
msgid "You cannot set negative temperatures. To turn the hotend off entirely, set its temperature to 0."
msgstr ""
#: pronterface.py:202 pronterface.py:223
msgid "You must enter a temperature."
msgstr ""
#: pronterface.py:215
msgid "Setting bed temperature to "
msgstr ""
#: pronterface.py:221
msgid "You cannot set negative temperatures. To turn the bed off entirely, set its temperature to 0."
msgstr ""
#: pronterface.py:238
msgid "Do you want to erase the macro?"
msgstr ""
#: pronterface.py:242
msgid "Cancelled."
msgstr ""
#: pronterface.py:271
msgid " Opens file"
msgstr ""
#: pronterface.py:271
msgid "&Open..."
msgstr ""
#: pronterface.py:272
msgid " Edit open file"
msgstr ""
#: pronterface.py:272
msgid "&Edit..."
msgstr ""
#: pronterface.py:274
msgid " Adjust SFACT settings"
msgstr ""
#: pronterface.py:274
msgid "SFACT Settings"
msgstr ""
#: pronterface.py:277
msgid " Quickly adjust SFACT settings for active profile"
msgstr ""
#: pronterface.py:277
msgid "SFACT Quick Settings"
msgstr ""
#: pronterface.py:281
msgid " Closes the Window"
msgstr ""
#: pronterface.py:281
msgid "E&xit"
msgstr ""
#: pronterface.py:282
msgid "&Print"
msgstr ""
#: pronterface.py:285
msgid "&Macros"
msgstr ""
#: pronterface.py:286
msgid "<&New...>"
msgstr ""
#: pronterface.py:287
msgid " Options dialog"
msgstr ""
#: pronterface.py:287
msgid "&Options"
msgstr ""
#: pronterface.py:288
msgid "&Settings"
msgstr ""
#: pronterface.py:304
msgid "Enter macro name"
msgstr ""
#: pronterface.py:307
msgid "Macro name:"
msgstr ""
#: pronterface.py:310
msgid "Ok"
msgstr ""
#: pronterface.py:314
msgid "Cancel"
msgstr ""
#: pronterface.py:332
msgid "' is being used by built-in command"
msgstr ""
#: pronterface.py:332
msgid "Name '"
msgstr ""
#: pronterface.py:368
msgid "Port:"
msgstr ""
#: pronterface.py:390
msgid "Connect"
msgstr ""
#: pronterface.py:392
msgid "Connect to the printer"
msgstr ""
#: pronterface.py:394
msgid "Disconnect"
msgstr ""
#: pronterface.py:398
msgid "Reset"
msgstr ""
#: pronterface.py:401 pronterface.py:579
msgid "Mini mode"
msgstr ""
#: pronterface.py:407
msgid ""
"Monitor\n"
"printer"
msgstr ""
#: pronterface.py:416
msgid "Load file"
msgstr ""
#: pronterface.py:419
msgid "SD Upload"
msgstr ""
#: pronterface.py:423
msgid "SD Print"
msgstr ""
#: pronterface.py:431 pronterface.py:1004 pronterface.py:1040
#: pronterface.py:1088 pronterface.py:1112 pronterface.py:1139
#: pronterface.py:1153
msgid "Pause"
msgstr ""
#: pronterface.py:445
msgid "Send"
msgstr ""
#: pronterface.py:453 pronterface.py:511
msgid "mm/min"
msgstr ""
#: pronterface.py:455
msgid "XY:"
msgstr ""
#: pronterface.py:457
msgid "Z:"
msgstr ""
#: pronterface.py:474
msgid "Heater:"
msgstr ""
#: pronterface.py:482 pronterface.py:494
msgid "Set"
msgstr ""
#: pronterface.py:486
msgid "Bed:"
msgstr ""
#: pronterface.py:505
msgid "mm"
msgstr ""
#: pronterface.py:538 pronterface.py:833 pronterface.py:1034
msgid "Not connected to printer."
msgstr ""
#: pronterface.py:586
msgid "Full mode"
msgstr ""
#: pronterface.py:624
msgid "Defines custom button. Usage: button <num> \"title\" [/c \"colour\"] command"
msgstr ""
#: pronterface.py:646
msgid "Custom button number should be between 0 and 63"
msgstr ""
#: pronterface.py:736
msgid "Edit custom button '%s'"
msgstr ""
#: pronterface.py:738
msgid "Move left <<"
msgstr ""
#: pronterface.py:741
msgid "Move right >>"
msgstr ""
#: pronterface.py:745
msgid "Remove custom button '%s'"
msgstr ""
#: pronterface.py:748
msgid "Add custom button"
msgstr ""
#: pronterface.py:763
msgid "event object missing"
msgstr ""
#: pronterface.py:791
msgid "Invalid period given."
msgstr ""
#: pronterface.py:794
msgid "Monitoring printer."
msgstr ""
#: pronterface.py:796
msgid "Done monitoring."
msgstr ""
#: pronterface.py:815
msgid "Printer is online. "
msgstr ""
#: pronterface.py:817 pronterface.py:954 pronterface.py:1002
msgid "Loaded "
msgstr ""
#: pronterface.py:820
msgid "Bed"
msgstr ""
#: pronterface.py:820
msgid "Hotend"
msgstr ""
#: pronterface.py:823
msgid " SD printing:%04.2f %%"
msgstr ""
#: pronterface.py:825
msgid " Printing:%04.2f %%"
msgstr ""
#: pronterface.py:879
msgid "Opening file failed."
msgstr ""
#: pronterface.py:885
msgid "Starting print"
msgstr ""
#: pronterface.py:908
msgid "Pick SD file"
msgstr ""
#: pronterface.py:908
msgid "Select the file to print"
msgstr ""
#: pronterface.py:936
msgid "Skeinforge execution failed."
msgstr ""
#: pronterface.py:943
msgid "Skeining..."
msgstr ""
#: pronterface.py:954 pronterface.py:1002
msgid ", %d lines"
msgstr ""
#: pronterface.py:963
msgid "Skeining "
msgstr ""
#: pronterface.py:965
msgid ""
"Skeinforge not found. \n"
"Please copy Skeinforge into a directory named \"skeinforge\" in the same directory as this file."
msgstr ""
#: pronterface.py:984
msgid "Open file to print"
msgstr ""
#: pronterface.py:985
msgid "STL and GCODE files (;*.gcode;*.g;*.stl;*.STL;)"
msgstr ""
#: pronterface.py:992
msgid "File not found!"
msgstr ""
#: pronterface.py:1011
msgid "mm of filament used in this print"
msgstr ""
#: pronterface.py:1031
msgid "No file loaded. Please use load first."
msgstr ""
#: pronterface.py:1042
msgid "Restart"
msgstr ""
#: pronterface.py:1046
msgid "File upload complete"
msgstr ""
#: pronterface.py:1065
msgid "Pick SD filename"
msgstr ""
#: pronterface.py:1081
msgid "Resume"
msgstr ""
#: pronterface.py:1147
msgid "Are you sure you want to reset the printer?"
msgstr ""
#: pronterface.py:1147
msgid "Reset?"
msgstr ""
#: pronterface.py:1226
msgid "Edit settings"
msgstr ""
#: pronterface.py:1228
msgid "Defaults"
msgstr ""
#: pronterface.py:1250
msgid "Custom button"
msgstr ""
#: pronterface.py:1258
msgid "Button title"
msgstr ""
#: pronterface.py:1261
msgid "Command"
msgstr ""
#: pronterface.py:1270
msgid "Color"
msgstr ""

View File

@ -1,8 +1,13 @@
#!/usr/bin/env python
# Set up Internationalization using gettext
import gettext
gettext.install('pronterface', '/usr/share/pronterface/locale', unicode=1)
try:
import wx
except:
print "WX is not installed. This program requires WX to run."
print _("WX is not installed. This program requires WX to run.")
raise
import printcore, os, sys, glob, time, threading, traceback, StringIO, gviz, traceback, cStringIO
try:
@ -47,7 +52,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.settings.last_bed_temperature = 0.0
self.filename=filename
os.putenv("UBUNTU_MENUPROXY","0")
wx.Frame.__init__(self,None,title="Printer Interface",size=size);
wx.Frame.__init__(self,None,title=_("Printer Interface"),size=size);
self.SetIcon(wx.Icon("P-face.ico",wx.BITMAP_TYPE_ICO))
self.panel=wx.Panel(self,-1,size=size)
self.statuscheck=False
@ -59,36 +64,36 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
ycol=(180,180,255)
zcol=(180,255,180)
self.cpbuttons=[
["X+100",("move X 100"),(2,0),xcol,(1,3)],
["X+10",("move X 10"),(3,0),xcol,(1,3)],
["X+1",("move X 1"),(4,0),xcol,(1,3)],
["X+0.1",("move X 0.1"),(5,0),xcol,(1,3)],
["HomeX",("home X"),(6,0),(205,205,78),(1,3)],
["X-0.1",("move X -0.1"),(7,0),xcol,(1,3)],
["X-1",("move X -1"),(8,0),xcol,(1,3)],
["X-10",("move X -10"),(9,0),xcol,(1,3)],
["X-100",("move X -100"),(10,0),xcol,(1,3)],
["Y+100",("move Y 100"),(2,3),ycol,(1,3)],
["Y+10",("move Y 10"),(3,3),ycol,(1,3)],
["Y+1",("move Y 1"),(4,3),ycol,(1,3)],
["Y+0.1",("move Y 0.1"),(5,3),ycol,(1,3)],
["HomeY",("home Y"),(6,3),(150,150,205),(1,3)],
["Y-0.1",("move Y -0.1"),(7,3),ycol,(1,3)],
["Y-1",("move Y -1"),(8,3),ycol,(1,3)],
["Y-10",("move Y -10"),(9,3),ycol,(1,3)],
["Y-100",("move Y -100"),(10,3),ycol,(1,3)],
["Motors off",("M84"),(2,6),(250,250,250),(1,3)],
["Z+10",("move Z 10"),(3,6),zcol,(1,3)],
["Z+1",("move Z 1"),(4,6),zcol,(1,3)],
["Z+0.1",("move Z 0.1"),(5,6),zcol,(1,3)],
["HomeZ",("home Z"),(6,6),(150,205,150),(1,3)],
["Z-0.1",("move Z -0.1"),(7,6),zcol,(1,3)],
["Z-1",("move Z -1"),(8,6),zcol,(1,3)],
["Z-10",("move Z -10"),(9,6),zcol,(1,3)],
["Home",("home"),(10,6),(250,250,250),(1,3)],
["Check temp",("M105"),(11,6),(225,200,200),(1,3)],
["Extrude",("extrude"),(13,0),(225,200,200),(1,2)],
["Reverse",("reverse"),(14,0),(225,200,200),(1,2)],
[_("X+100"),("move X 100"),(2,0),xcol,(1,3)],
[_("X+10"),("move X 10"),(3,0),xcol,(1,3)],
[_("X+1"),("move X 1"),(4,0),xcol,(1,3)],
[_("X+0.1"),("move X 0.1"),(5,0),xcol,(1,3)],
[_("HomeX"),("home X"),(6,0),(205,205,78),(1,3)],
[_("X-0.1"),("move X -0.1"),(7,0),xcol,(1,3)],
[_("X-1"),("move X -1"),(8,0),xcol,(1,3)],
[_("X-10"),("move X -10"),(9,0),xcol,(1,3)],
[_("X-100"),("move X -100"),(10,0),xcol,(1,3)],
[_("Y+100"),("move Y 100"),(2,3),ycol,(1,3)],
[_("Y+10"),("move Y 10"),(3,3),ycol,(1,3)],
[_("Y+1"),("move Y 1"),(4,3),ycol,(1,3)],
[_("Y+0.1"),("move Y 0.1"),(5,3),ycol,(1,3)],
[_("HomeY"),("home Y"),(6,3),(150,150,205),(1,3)],
[_("Y-0.1"),("move Y -0.1"),(7,3),ycol,(1,3)],
[_("Y-1"),("move Y -1"),(8,3),ycol,(1,3)],
[_("Y-10"),("move Y -10"),(9,3),ycol,(1,3)],
[_("Y-100"),("move Y -100"),(10,3),ycol,(1,3)],
[_("Motors off"),("M84"),(2,6),(250,250,250),(1,3)],
[_("Z+10"),("move Z 10"),(3,6),zcol,(1,3)],
[_("Z+1"),("move Z 1"),(4,6),zcol,(1,3)],
[_("Z+0.1"),("move Z 0.1"),(5,6),zcol,(1,3)],
[_("HomeZ"),("home Z"),(6,6),(150,205,150),(1,3)],
[_("Z-0.1"),("move Z -0.1"),(7,6),zcol,(1,3)],
[_("Z-1"),("move Z -1"),(8,6),zcol,(1,3)],
[_("Z-10"),("move Z -10"),(9,6),zcol,(1,3)],
[_("Home"),("home"),(10,6),(250,250,250),(1,3)],
[_("Check temp"),("M105"),(11,6),(225,200,200),(1,3)],
[_("Extrude"),("extrude"),(13,0),(225,200,200),(1,2)],
[_("Reverse"),("reverse"),(14,0),(225,200,200),(1,2)],
]
self.custombuttons=[]
self.btndict={}
@ -104,13 +109,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.cbutton_save(n,self.custombuttons[n])
os.rename("custombtn.txt","custombtn.old")
rco=open("custombtn.txt","w")
rco.write("# I moved all your custom buttons into .pronsolerc.\n# Please don't add them here any more.\n# Backup of your old buttons is in custombtn.old\n")
rco.write(_("# I moved all your custom buttons into .pronsolerc.\n# Please don't add them here any more.\n# Backup of your old buttons is in custombtn.old\n"))
rco.close()
except IOError,x:
print str(x)
else:
print "Note!!! You have specified custom buttons in both custombtn.txt and .pronsolerc"
print "Ignoring custombtn.txt. Remove all current buttons to revert to custombtn.txt"
print _("Note!!! You have specified custom buttons in both custombtn.txt and .pronsolerc")
print _("Ignoring custombtn.txt. Remove all current buttons to revert to custombtn.txt")
except:
pass
@ -133,11 +138,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if(self.p.queueindex==0):
print "Print took "+str(int(time.time()-self.starttime)/60)+" minutes "+str(int(time.time()-self.starttime)%60)+" seconds"
wx.CallAfter(self.pausebtn.Disable)
wx.CallAfter(self.printbtn.SetLabel,"Print")
wx.CallAfter(self.printbtn.SetLabel,_("Print"))
def online(self):
print "Printer is now online"
print _("Printer is now online")
wx.CallAfter(self.connectbtn.Disable)
for i in self.printerControls:
wx.CallAfter(i.Enable)
@ -186,15 +191,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if f>=0:
if self.p.online:
self.p.send_now("M104 S"+l)
print "Setting hotend temperature to ",f," degrees Celsius."
print _("Setting hotend temperature to "),f,_(" degrees Celsius.")
self.htemp.SetValue(l)
self.set("last_temperature",str(f))
else:
print "Printer is not online."
print _("Printer is not online.")
else:
print "You cannot set negative temperatures. To turn the hotend off entirely, set its temperature to 0."
print _("You cannot set negative temperatures. To turn the hotend off entirely, set its temperature to 0.")
except:
print "You must enter a temperature."
print _("You must enter a temperature.")
def do_bedtemp(self,l=""):
try:
@ -207,15 +212,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if f>=0:
if self.p.online:
self.p.send_now("M140 S"+l)
print "Setting bed temperature to ",f," degrees Celsius."
print _("Setting bed temperature to "),f,_(" degrees Celsius.")
self.btemp.SetValue(l)
self.set("last_bed_temperature",str(f))
else:
print "Printer is not online."
print _("Printer is not online.")
else:
print "You cannot set negative temperatures. To turn the bed off entirely, set its temperature to 0."
print _("You cannot set negative temperatures. To turn the bed off entirely, set its temperature to 0.")
except:
print "You must enter a temperature."
print _("You must enter a temperature.")
def end_macro(self):
pronsole.pronsole.end_macro(self)
@ -230,11 +235,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def cb(definition):
if len(definition.strip())==0:
if old_macro_definition!="":
dialog = wx.MessageDialog(self,"Do you want to erase the macro?",style=wx.YES_NO|wx.YES_DEFAULT|wx.ICON_QUESTION)
dialog = wx.MessageDialog(self,_("Do you want to erase the macro?"),style=wx.YES_NO|wx.YES_DEFAULT|wx.ICON_QUESTION)
if dialog.ShowModal()==wx.ID_YES:
self.delete_macro(macro_name)
return
print "Cancelled."
print _("Cancelled.")
return
self.cur_macro_name = macro_name
self.cur_macro_def = definition
@ -263,24 +268,24 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def popmenu(self):
self.menustrip = wx.MenuBar()
m = wx.Menu()
self.Bind(wx.EVT_MENU, self.loadfile, m.Append(-1,"&Open..."," Opens file"))
self.Bind(wx.EVT_MENU, self.do_editgcode, m.Append(-1,"&Edit..."," Edit open file"))
self.Bind(wx.EVT_MENU, self.loadfile, m.Append(-1,_("&Open..."),_(" Opens file")))
self.Bind(wx.EVT_MENU, self.do_editgcode, m.Append(-1,_("&Edit..."),_(" Edit open file")))
if sys.platform != 'darwin':
self.Bind(wx.EVT_MENU, lambda x:threading.Thread(target=lambda :self.do_skein("set")).start(), m.Append(-1,"SFACT Settings"," Adjust SFACT settings"))
self.Bind(wx.EVT_MENU, lambda x:threading.Thread(target=lambda :self.do_skein("set")).start(), m.Append(-1,_("SFACT Settings"),_(" Adjust SFACT settings")))
try:
from SkeinforgeQuickEditDialog import SkeinforgeQuickEditDialog
self.Bind(wx.EVT_MENU, lambda *e:SkeinforgeQuickEditDialog(self), m.Append(-1,"SFACT Quick Settings"," Quickly adjust SFACT settings for active profile"))
self.Bind(wx.EVT_MENU, lambda *e:SkeinforgeQuickEditDialog(self), m.Append(-1,_("SFACT Quick Settings"),_(" Quickly adjust SFACT settings for active profile")))
except:
pass
self.Bind(wx.EVT_MENU, self.OnExit, m.Append(wx.ID_EXIT,"E&xit"," Closes the Window"))
self.menustrip.Append(m,"&Print")
self.Bind(wx.EVT_MENU, self.OnExit, m.Append(wx.ID_EXIT,_("E&xit"),_(" Closes the Window")))
self.menustrip.Append(m,_("&Print"))
m = wx.Menu()
self.macros_menu = wx.Menu()
m.AppendSubMenu(self.macros_menu, "&Macros")
self.Bind(wx.EVT_MENU, self.new_macro, self.macros_menu.Append(-1, "<&New...>"))
self.Bind(wx.EVT_MENU, lambda *e:options(self), m.Append(-1,"&Options"," Options dialog"))
self.menustrip.Append(m,"&Settings")
m.AppendSubMenu(self.macros_menu, _("&Macros"))
self.Bind(wx.EVT_MENU, self.new_macro, self.macros_menu.Append(-1, _("<&New...>")))
self.Bind(wx.EVT_MENU, lambda *e:options(self), m.Append(-1,_("&Options"),_(" Options dialog")))
self.menustrip.Append(m,_("&Settings"))
self.update_macros_menu()
self.SetMenuBar(self.menustrip)
@ -296,17 +301,17 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
macroed(self.filename,self.f,self.doneediting,1)
def new_macro(self,e=None):
dialog = wx.Dialog(self,-1,"Enter macro name",size=(200,100))
dialog = wx.Dialog(self,-1,_("Enter macro name"),size=(200,100))
panel = wx.Panel(dialog,-1)
vbox = wx.BoxSizer(wx.VERTICAL)
wx.StaticText(panel,-1,"Macro name:",(8,14))
wx.StaticText(panel,-1,_("Macro name:"),(8,14))
dialog.namectrl = wx.TextCtrl(panel,-1,'',(80,8),size=(100,24),style=wx.TE_PROCESS_ENTER)
hbox = wx.BoxSizer(wx.HORIZONTAL)
okb = wx.Button(dialog,wx.ID_OK,"Ok",size=(50,24))
okb = wx.Button(dialog,wx.ID_OK,_("Ok"),size=(50,24))
dialog.Bind(wx.EVT_TEXT_ENTER,lambda e:dialog.EndModal(wx.ID_OK),dialog.namectrl)
#dialog.Bind(wx.EVT_BUTTON,lambda e:self.new_macro_named(dialog,e),okb)
hbox.Add(okb)
hbox.Add(wx.Button(dialog,wx.ID_CANCEL,"Cancel",size=(50,24)))
hbox.Add(wx.Button(dialog,wx.ID_CANCEL,_("Cancel"),size=(50,24)))
vbox.Add(panel)
vbox.Add(hbox,1,wx.ALIGN_CENTER|wx.TOP|wx.BOTTOM,10)
dialog.SetSizer(vbox)
@ -324,7 +329,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.macros.has_key(macro):
old_def = self.macros[macro]
elif hasattr(self.__class__,"do_"+macro):
print "Name '"+macro+"' is being used by built-in command"
print _("Name '")+macro+_("' is being used by built-in command")
return
elif len([c for c in macro if not c.isalnum() and c != "_"]):
print "Macro name may contain only alphanumeric symbols and underscores"
@ -360,7 +365,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#lower section contains the rest of the window - manual controls, console, visualizations
#TOP ROW:
uts=self.uppertopsizer=wx.BoxSizer(wx.HORIZONTAL)
uts.Add(wx.StaticText(self.panel,-1,"Port:",pos=(0,5)),wx.TOP|wx.LEFT,5)
uts.Add(wx.StaticText(self.panel,-1,_("Port:"),pos=(0,5)),wx.TOP|wx.LEFT,5)
scan=self.scanserial()
self.serialport = wx.ComboBox(self.panel, -1,
choices=scan,
@ -382,24 +387,24 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
except:
pass
uts.Add(self.baud)
self.connectbtn=wx.Button(self.panel,-1,"Connect",pos=(380,0))
self.connectbtn=wx.Button(self.panel,-1,_("Connect"),pos=(380,0))
uts.Add(self.connectbtn)
self.connectbtn.SetToolTipString("Connect to the printer")
self.connectbtn.SetToolTipString(_("Connect to the printer"))
self.connectbtn.Bind(wx.EVT_BUTTON,self.connect)
self.disconnectbtn=wx.Button(self.panel,-1,"Disconnect",pos=(470,0))
self.disconnectbtn=wx.Button(self.panel,-1,_("Disconnect"),pos=(470,0))
self.disconnectbtn.Bind(wx.EVT_BUTTON,self.disconnect)
self.printerControls.append(self.disconnectbtn)
uts.Add(self.disconnectbtn)
self.resetbtn=wx.Button(self.panel,-1,"Reset",pos=(560,0))
self.resetbtn=wx.Button(self.panel,-1,_("Reset"),pos=(560,0))
self.resetbtn.Bind(wx.EVT_BUTTON,self.reset)
uts.Add(self.resetbtn)
self.minibtn=wx.Button(self.panel,-1,"Mini mode",pos=(690,0))
self.minibtn=wx.Button(self.panel,-1,_("Mini mode"),pos=(690,0))
self.minibtn.Bind(wx.EVT_BUTTON,self.toggleview)
uts.Add((10,-1))
self.monitorbox=wx.CheckBox(self.panel,-1,"",pos=(450,37))
uts.Add((15,-1))
uts.Add(self.monitorbox)
uts.Add(wx.StaticText(self.panel,-1,"Monitor\nprinter",pos=(470,37)))
uts.Add(wx.StaticText(self.panel,-1,_("Monitor\nprinter"),pos=(470,37)))
self.monitorbox.Bind(wx.EVT_CHECKBOX,self.setmonitor)
uts.Add((15,-1),flag=wx.EXPAND)
@ -408,22 +413,22 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#SECOND ROW
ubs=self.upperbottomsizer=wx.BoxSizer(wx.HORIZONTAL)
self.loadbtn=wx.Button(self.panel,-1,"Load file",pos=(0,40))
self.loadbtn=wx.Button(self.panel,-1,_("Load file"),pos=(0,40))
self.loadbtn.Bind(wx.EVT_BUTTON,self.loadfile)
ubs.Add(self.loadbtn)
self.uploadbtn=wx.Button(self.panel,-1,"SD Upload",pos=(90,40))
self.uploadbtn=wx.Button(self.panel,-1,_("SD Upload"),pos=(90,40))
self.uploadbtn.Bind(wx.EVT_BUTTON,self.upload)
self.printerControls.append(self.uploadbtn)
ubs.Add(self.uploadbtn)
self.sdprintbtn=wx.Button(self.panel,-1,"SD Print",pos=(180,40))
self.sdprintbtn=wx.Button(self.panel,-1,_("SD Print"),pos=(180,40))
self.sdprintbtn.Bind(wx.EVT_BUTTON,self.sdprintfile)
self.printerControls.append(self.sdprintbtn)
ubs.Add(self.sdprintbtn)
self.printbtn=wx.Button(self.panel,-1,"Print",pos=(270,40))
self.printbtn=wx.Button(self.panel,-1,_("Print"),pos=(270,40))
self.printbtn.Bind(wx.EVT_BUTTON,self.printfile)
self.printbtn.Disable()
ubs.Add(self.printbtn)
self.pausebtn=wx.Button(self.panel,-1,"Pause",pos=(360,40))
self.pausebtn=wx.Button(self.panel,-1,_("Pause"),pos=(360,40))
self.pausebtn.Bind(wx.EVT_BUTTON,self.pause)
ubs.Add(self.pausebtn)
ubs.Add((50,-1),flag=wx.EXPAND)
@ -437,7 +442,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.commandbox.Bind(wx.EVT_TEXT_ENTER,self.sendline)
#self.printerControls.append(self.commandbox)
lbrs.Add(self.commandbox)
self.sendbtn=wx.Button(self.panel,-1,"Send",pos=(700,420))
self.sendbtn=wx.Button(self.panel,-1,_("Send"),pos=(700,420))
self.sendbtn.Bind(wx.EVT_BUTTON,self.sendline)
#self.printerControls.append(self.sendbtn)
lbrs.Add(self.sendbtn)
@ -445,11 +450,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#left pane
lls=self.lowerlsizer=wx.GridBagSizer()
lls.Add(wx.StaticText(self.panel,-1,"mm/min",pos=(60,69)),pos=(0,4),span=(1,4))
lls.Add(wx.StaticText(self.panel,-1,_("mm/min"),pos=(60,69)),pos=(0,4),span=(1,4))
self.xyfeedc=wx.SpinCtrl(self.panel,-1,str(self.settings.xy_feedrate),min=0,max=50000,size=(70,25),pos=(25,83))
lls.Add(wx.StaticText(self.panel,-1,"XY:",pos=(2,90-2)),pos=(1,0),span=(1,2))
lls.Add(wx.StaticText(self.panel,-1,_("XY:"),pos=(2,90-2)),pos=(1,0),span=(1,2))
lls.Add(self.xyfeedc,pos=(1,2),span=(1,4))
lls.Add(wx.StaticText(self.panel,-1,"Z:",pos=(90,90-2)),pos=(1,6),span=(1,2))
lls.Add(wx.StaticText(self.panel,-1,_("Z:"),pos=(90,90-2)),pos=(1,6),span=(1,2))
self.zfeedc=wx.SpinCtrl(self.panel,-1,str(self.settings.z_feedrate),min=0,max=50000,size=(70,25),pos=(105,83))
lls.Add(self.zfeedc,pos=(1,8),span=(1,4))
@ -466,7 +471,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
lls.Add(btn,pos=i[2],span=i[4])
lls.Add(wx.StaticText(self.panel,-1,"Heater:",pos=(0,343)),pos=(11,0),span=(1,1))
lls.Add(wx.StaticText(self.panel,-1,_("Heater:"),pos=(0,343)),pos=(11,0),span=(1,1))
htemp_choices=[self.temps[i]+" ("+i+")" for i in sorted(self.temps.keys(),key=lambda x:self.temps[x])]
if self.settings.last_temperature not in map(float,self.temps.values()):
htemp_choices = [str(self.settings.last_temperature)] + htemp_choices
@ -474,11 +479,11 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
choices=htemp_choices,style=wx.CB_DROPDOWN, size=(90,25),pos=(45,337))
self.htemp.SetValue("0")
lls.Add(self.htemp,pos=(11,1),span=(1,3))
self.settbtn=wx.Button(self.panel,-1,"Set",size=(38,-1),pos=(135,335))
self.settbtn=wx.Button(self.panel,-1,_("Set"),size=(38,-1),pos=(135,335))
self.settbtn.Bind(wx.EVT_BUTTON,self.do_settemp)
self.printerControls.append(self.settbtn)
lls.Add(self.settbtn,pos=(11,4),span=(1,2))
lls.Add(wx.StaticText(self.panel,-1,"Bed:",pos=(0,343)),pos=(12,0),span=(1,1))
lls.Add(wx.StaticText(self.panel,-1,_("Bed:"),pos=(0,343)),pos=(12,0),span=(1,1))
btemp_choices=[self.bedtemps[i]+" ("+i+")" for i in sorted(self.bedtemps.keys(),key=lambda x:self.bedtemps[x])]
if self.settings.last_bed_temperature not in map(float,self.bedtemps.values()):
btemp_choices = [str(self.settings.last_bed_temperature)] + btemp_choices
@ -486,7 +491,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
choices=btemp_choices,style=wx.CB_DROPDOWN, size=(90,25),pos=(45,367))
self.btemp.SetValue("0")
lls.Add(self.btemp,pos=(12,1),span=(1,3))
self.setbbtn=wx.Button(self.panel,-1,"Set",size=(38,-1),pos=(135,365))
self.setbbtn=wx.Button(self.panel,-1,_("Set"),size=(38,-1),pos=(135,365))
self.setbbtn.Bind(wx.EVT_BUTTON,self.do_bedtemp)
self.printerControls.append(self.setbbtn)
lls.Add(self.setbbtn,pos=(12,4),span=(1,2))
@ -497,13 +502,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.edist.SetBackgroundColour((225,200,200))
self.edist.SetForegroundColour("black")
lls.Add(self.edist,pos=(13,3),span=(1,2))
lls.Add(wx.StaticText(self.panel,-1,"mm",pos=(130,407)),pos=(13,5),span=(1,2))
lls.Add(wx.StaticText(self.panel,-1,_("mm"),pos=(130,407)),pos=(13,5),span=(1,2))
self.efeedc=wx.SpinCtrl(self.panel,-1,str(self.settings.e_feedrate),min=0,max=50000,size=(60,25),pos=(70,397+28))
self.efeedc.SetBackgroundColour((225,200,200))
self.efeedc.SetForegroundColour("black")
self.efeedc.Bind(wx.EVT_SPINCTRL,self.setfeeds)
lls.Add(self.efeedc,pos=(14,3),span=(1,2))
lls.Add(wx.StaticText(self.panel,-1,"mm/min",pos=(130,407+27)),pos=(14,5),span=(1,2))
lls.Add(wx.StaticText(self.panel,-1,_("mm/min"),pos=(130,407+27)),pos=(14,5),span=(1,2))
self.xyfeedc.Bind(wx.EVT_SPINCTRL,self.setfeeds)
self.zfeedc.Bind(wx.EVT_SPINCTRL,self.setfeeds)
self.zfeedc.SetBackgroundColour((180,255,180))
@ -530,7 +535,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.topsizer.Add(self.lowersizer)
self.panel.SetSizer(self.topsizer)
self.status=self.CreateStatusBar()
self.status.SetStatusText("Not connected to printer.")
self.status.SetStatusText(_("Not connected to printer."))
self.panel.Bind(wx.EVT_MOUSE_EVENTS,self.editbutton)
self.Bind(wx.EVT_CLOSE, self.kill)
self.topsizer.Layout()
@ -571,14 +576,14 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.topsizer.Fit(self)
#self.SetSize(winsize)
wx.CallAfter(self.minibtn.SetLabel, "Mini mode")
wx.CallAfter(self.minibtn.SetLabel, _("Mini mode"))
else:
self.mini=True
self.uppersizer.Fit(self)
#self.SetSize(winssize)
wx.CallAfter(self.minibtn.SetLabel, "Full mode")
wx.CallAfter(self.minibtn.SetLabel, _("Full mode"))
def cbuttons_reload(self):
allcbs = []
@ -616,7 +621,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.topsizer.Layout()
def help_button(self):
print 'Defines custom button. Usage: button <num> "title" [/c "colour"] command'
print _('Defines custom button. Usage: button <num> "title" [/c "colour"] command')
def do_button(self,argstr):
def nextarg(rest):
@ -638,7 +643,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
pass
command=argstr.strip()
if num<0 or num>=64:
print "Custom button number should be between 0 and 63"
print _("Custom button number should be between 0 and 63")
return
while num >= len(self.custombuttons):
self.custombuttons+=[None]
@ -728,19 +733,19 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
popupmenu = wx.Menu()
obj = e.GetEventObject()
if hasattr(obj,"custombutton"):
item = popupmenu.Append(-1,"Edit custom button '%s'" % e.GetEventObject().GetLabelText())
item = popupmenu.Append(-1,_("Edit custom button '%s'") % e.GetEventObject().GetLabelText())
self.Bind(wx.EVT_MENU,lambda e,button=e.GetEventObject():self.cbutton_edit(e,button),item)
item = popupmenu.Append(-1,"Move left <<")
item = popupmenu.Append(-1,_("Move left <<"))
self.Bind(wx.EVT_MENU,lambda e,button=e.GetEventObject():self.cbutton_order(e,button,-1),item)
if obj.custombutton == 0: item.Enable(False)
item = popupmenu.Append(-1,"Move right >>")
item = popupmenu.Append(-1,_("Move right >>"))
self.Bind(wx.EVT_MENU,lambda e,button=e.GetEventObject():self.cbutton_order(e,button,1),item)
if obj.custombutton == 63: item.Enable(False)
pos = self.panel.ScreenToClient(e.GetEventObject().ClientToScreen(pos))
item = popupmenu.Append(-1,"Remove custom button '%s'" % e.GetEventObject().GetLabelText())
item = popupmenu.Append(-1,_("Remove custom button '%s'") % e.GetEventObject().GetLabelText())
self.Bind(wx.EVT_MENU,lambda e,button=e.GetEventObject():self.cbutton_remove(e,button),item)
else:
item = popupmenu.Append(-1,"Add custom button")
item = popupmenu.Append(-1,_("Add custom button"))
self.Bind(wx.EVT_MENU,self.cbutton_edit,item)
self.panel.PopupMenu(popupmenu, pos)
else:
@ -755,7 +760,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.onecmd(e.GetEventObject().properties[1])
self.cur_button=None
except:
print "event object missing"
print _("event object missing")
self.cur_button=None
raise
@ -783,12 +788,12 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.monitor_interval=float(l)
self.monitorbox.SetValue(self.monitor_interval>0)
except:
print "Invalid period given."
print _("Invalid period given.")
self.setmonitor(None)
if self.monitor:
print "Monitoring printer."
print _("Monitoring printer.")
else:
print "Done monitoring."
print _("Done monitoring.")
def setmonitor(self,e):
@ -807,17 +812,17 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
while(self.statuscheck):
string=""
if(self.p.online):
string+="Printer is online. "
string+=_("Printer is online. ")
try:
string+="Loaded "+os.path.split(self.filename)[1]+" "
string+=_("Loaded ")+os.path.split(self.filename)[1]+" "
except:
pass
string+=(self.tempreport.replace("\r","").replace("T","Hotend").replace("B","Bed").replace("\n","").replace("ok ",""))+" "
string+=(self.tempreport.replace("\r","").replace("T",_("Hotend")).replace("B",_("Bed")).replace("\n","").replace("ok ",""))+" "
wx.CallAfter(self.tempdisp.SetLabel,self.tempreport.strip().replace("ok ",""))
if self.sdprinting:
string+= " SD printing:%04.2f %%"%(self.percentdone,)
string+= _(" SD printing:%04.2f %%") % (self.percentdone,)
if self.p.printing:
string+= " Printing:%04.2f %%"%(100*float(self.p.queueindex)/len(self.p.mainqueue),)
string+= _(" Printing:%04.2f %%") % (100*float(self.p.queueindex)/len(self.p.mainqueue),)
wx.CallAfter(self.status.SetStatusText,string)
wx.CallAfter(self.gviz.Refresh)
if(self.monitor and self.p.online):
@ -825,7 +830,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
self.p.send_now("M27")
self.p.send_now("M105")
time.sleep(self.monitor_interval)
wx.CallAfter(self.status.SetStatusText,"Not connected to printer.")
wx.CallAfter(self.status.SetStatusText,_("Not connected to printer."))
except:
pass #if window has been closed
def capture(self, func, *args, **kwargs):
@ -871,13 +876,13 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def waitforsdresponse(self,l):
if "file.open failed" in l:
wx.CallAfter(self.status.SetStatusText,"Opening file failed.")
wx.CallAfter(self.status.SetStatusText,_("Opening file failed."))
self.recvlisteners.remove(self.waitforsdresponse)
return
if "File opened" in l:
wx.CallAfter(self.status.SetStatusText,l)
if "File selected" in l:
wx.CallAfter(self.status.SetStatusText,"Starting print")
wx.CallAfter(self.status.SetStatusText,_("Starting print"))
self.sdprinting=1
self.p.send_now("M24")
self.startcb()
@ -900,7 +905,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
def filesloaded(self):
dlg=wx.SingleChoiceDialog(self, "Select the file to print", "Pick SD file", self.sdfiles)
dlg=wx.SingleChoiceDialog(self, _("Select the file to print"), _("Pick SD file"), self.sdfiles)
if(dlg.ShowModal()==wx.ID_OK):
target=dlg.GetStringSelection()
if len(target):
@ -928,14 +933,14 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
#print len(self.cout.getvalue().split())
self.stopsf=1
except:
print "Skeinforge execution failed."
print _("Skeinforge execution failed.")
self.stopsf=1
traceback.print_exc(file=sys.stdout)
def skein_monitor(self):
while(not self.stopsf):
try:
wx.CallAfter(self.status.SetStatusText,"Skeining...")#+self.cout.getvalue().split("\n")[-1])
wx.CallAfter(self.status.SetStatusText,_("Skeining..."))#+self.cout.getvalue().split("\n")[-1])
except:
pass
time.sleep(0.1)
@ -946,18 +951,18 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.p.online:
wx.CallAfter(self.printbtn.Enable)
wx.CallAfter(self.status.SetStatusText,"Loaded "+self.filename+", %d lines"%(len(self.f),))
wx.CallAfter(self.status.SetStatusText,_("Loaded ")+self.filename+_(", %d lines") % (len(self.f),))
wx.CallAfter(self.pausebtn.Disable)
wx.CallAfter(self.printbtn.SetLabel,"Print")
wx.CallAfter(self.printbtn.SetLabel,_("Print"))
threading.Thread(target=self.loadviz).start()
except:
self.filename=fn
def skein(self,filename):
print "Skeining "+filename
print _("Skeining ") + filename
if not os.path.exists("skeinforge"):
print "Skeinforge not found. \nPlease copy Skeinforge into a directory named \"skeinforge\" in the same directory as this file."
print _("Skeinforge not found. \nPlease copy Skeinforge into a directory named \"skeinforge\" in the same directory as this file.")
return
if not os.path.exists("skeinforge/__init__.py"):
f=open("skeinforge/__init__.py","w")
@ -976,15 +981,15 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
basedir=os.path.split(self.filename)[0]
except:
pass
dlg=wx.FileDialog(self,"Open file to print",basedir,style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
dlg.SetWildcard("STL and GCODE files (;*.gcode;*.g;*.stl;*.STL;)")
dlg=wx.FileDialog(self,_("Open file to print"),basedir,style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST)
dlg.SetWildcard(_("STL and GCODE files (;*.gcode;*.g;*.stl;*.STL;)"))
if(filename is not None or dlg.ShowModal() == wx.ID_OK):
if filename is not None:
name=filename
else:
name=dlg.GetPath()
if not(os.path.exists(name)):
self.status.SetStatusText("File not found!")
self.status.SetStatusText(_("File not found!"))
return
path = os.path.split(name)[0]
if path != self.settings.last_file_path:
@ -994,16 +999,16 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
else:
self.f=[i.replace("\n","").replace("\r","") for i in open(name)]
self.filename=name
self.status.SetStatusText("Loaded "+name+", %d lines"%(len(self.f),))
wx.CallAfter(self.printbtn.SetLabel, "Print")
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
self.status.SetStatusText(_("Loaded ") + name + _(", %d lines") % (len(self.f),))
wx.CallAfter(self.printbtn.SetLabel, _("Print"))
wx.CallAfter(self.pausebtn.SetLabel, _("Pause"))
wx.CallAfter(self.pausebtn.Disable)
if self.p.online:
wx.CallAfter(self.printbtn.Enable)
threading.Thread(target=self.loadviz).start()
def loadviz(self):
print pronsole.totalelength(self.f),"mm of filament used in this print"
print pronsole.totalelength(self.f), _("mm of filament used in this print")
self.gviz.clear()
self.gwindow.p.clear()
for i in self.f:
@ -1023,22 +1028,22 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
return
if self.f is None or not len(self.f):
wx.CallAfter(self.status.SetStatusText,"No file loaded. Please use load first.")
wx.CallAfter(self.status.SetStatusText, _("No file loaded. Please use load first."))
return
if not self.p.online:
wx.CallAfter(self.status.SetStatusText,"Not connected to printer.")
wx.CallAfter(self.status.SetStatusText,_("Not connected to printer."))
return
self.on_startprint()
self.p.startprint(self.f)
def on_startprint(self):
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
wx.CallAfter(self.pausebtn.SetLabel, _("Pause"))
wx.CallAfter(self.pausebtn.Enable)
wx.CallAfter(self.printbtn.SetLabel, "Restart")
wx.CallAfter(self.printbtn.SetLabel, _("Restart"))
def endupload(self):
self.p.send_now("M29 ")
wx.CallAfter(self.status.SetStatusText,"File upload complete")
wx.CallAfter(self.status.SetStatusText, _("File upload complete"))
time.sleep(0.5)
self.p.clear=True
self.uploading=False
@ -1057,7 +1062,7 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
return
if not self.p.online:
return
dlg=wx.TextEntryDialog(self,"Enter a target filename in 8.3 format:","Pick SD filename",dosify(self.filename))
dlg=wx.TextEntryDialog(self, ("Enter a target filename in 8.3 format:"), _("Pick SD filename") ,dosify(self.filename))
if dlg.ShowModal()==wx.ID_OK:
self.p.send_now("M28 "+str(dlg.GetValue()))
self.recvlisteners+=[self.uploadtrigger]
@ -1073,14 +1078,14 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
return
self.p.pause()
self.paused=True
wx.CallAfter(self.pausebtn.SetLabel, "Resume")
wx.CallAfter(self.pausebtn.SetLabel, _("Resume"))
else:
self.paused=False
if self.sdprinting:
self.p.send_now("M24")
else:
self.p.resume()
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
wx.CallAfter(self.pausebtn.SetLabel, _("Pause"))
def sdprintfile(self,event):
@ -1104,8 +1109,8 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.paused:
self.p.paused=0
self.p.printing=0
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
wx.CallAfter(self.printbtn.SetLabel, "Print")
wx.CallAfter(self.pausebtn.SetLabel, _("Pause"))
wx.CallAfter(self.printbtn.SetLabel, _("Print"))
self.paused=0
if self.sdprinting:
self.p.send_now("M26 S0")
@ -1131,22 +1136,22 @@ class PronterWindow(wx.Frame,pronsole.pronsole):
if self.paused:
self.p.paused=0
self.p.printing=0
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
wx.CallAfter(self.printbtn.SetLabel, "Print")
wx.CallAfter(self.pausebtn.SetLabel, _("Pause"))
wx.CallAfter(self.printbtn.SetLabel, _("Print"))
self.paused=0
if self.sdprinting:
self.p.send_now("M26 S0")
def reset(self,event):
dlg=wx.MessageDialog(self,"Are you sure you want to reset the printer?","Reset?",wx.YES|wx.NO)
dlg=wx.MessageDialog(self, _("Are you sure you want to reset the printer?"), _("Reset?"), wx.YES|wx.NO)
if dlg.ShowModal()==wx.ID_YES:
self.p.reset()
if self.paused:
self.p.paused=0
self.p.printing=0
wx.CallAfter(self.pausebtn.SetLabel, "Pause")
wx.CallAfter(self.printbtn.SetLabel, "Print")
wx.CallAfter(self.pausebtn.SetLabel, _("Pause"))
wx.CallAfter(self.printbtn.SetLabel, _("Print"))
self.paused=0
class macroed(wx.Dialog):
@ -1164,11 +1169,11 @@ class macroed(wx.Dialog):
title = wx.StaticText(self.panel,-1,title%macro_name)
title.SetFont(wx.Font(11,wx.NORMAL,wx.NORMAL,wx.BOLD))
titlesizer.Add(title,1)
self.okb = wx.Button(self.panel,-1,"Save")
self.okb.Bind(wx.EVT_BUTTON,self.save)
self.okb = wx.Button(self.panel, -1, ("Save"))
self.okb.Bind(wx.EVT_BUTTON, self.save)
titlesizer.Add(self.okb)
self.cancelb = wx.Button(self.panel,-1,"Cancel")
self.cancelb.Bind(wx.EVT_BUTTON,self.close)
self.cancelb = wx.Button(self.panel, -1, ("Cancel"))
self.cancelb.Bind(wx.EVT_BUTTON, self.close)
titlesizer.Add(self.cancelb)
topsizer=wx.BoxSizer(wx.VERTICAL)
topsizer.Add(titlesizer,0,wx.EXPAND)
@ -1218,9 +1223,9 @@ class macroed(wx.Dialog):
class options(wx.Dialog):
"""Options editor"""
def __init__(self,pronterface):
wx.Dialog.__init__(self,None,title="Edit settings")
wx.Dialog.__init__(self, None, title=_("Edit settings"))
topsizer=wx.BoxSizer(wx.VERTICAL)
vbox=wx.StaticBoxSizer(wx.StaticBox(self,label="Defaults"),wx.VERTICAL)
vbox=wx.StaticBoxSizer(wx.StaticBox(self, label=_("Defaults")) ,wx.VERTICAL)
topsizer.Add(vbox,1,wx.ALL+wx.EXPAND)
grid=wx.GridSizer(rows=0,cols=2,hgap=8,vgap=2)
vbox.Add(grid,0,wx.EXPAND)
@ -1242,7 +1247,7 @@ class options(wx.Dialog):
class ButtonEdit(wx.Dialog):
"""Custom button edit dialog"""
def __init__(self,pronterface):
wx.Dialog.__init__(self,None,title="Custom button",style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
wx.Dialog.__init__(self, None, title=_("Custom button"),style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER)
self.pronterface=pronterface
topsizer=wx.BoxSizer(wx.VERTICAL)
vbox=wx.StaticBoxSizer(wx.StaticBox(self,label=""),wx.VERTICAL)
@ -1250,10 +1255,10 @@ class ButtonEdit(wx.Dialog):
grid=wx.FlexGridSizer(rows=0,cols=2,hgap=4,vgap=2)
grid.AddGrowableCol(1,1)
vbox.Add(grid,0,wx.EXPAND)
grid.Add(wx.StaticText(self,-1,"Button title"),0,wx.BOTTOM+wx.RIGHT)
grid.Add(wx.StaticText(self,-1, _("Button title")), 0, wx.BOTTOM+wx.RIGHT)
self.name=wx.TextCtrl(self,-1,"")
grid.Add(self.name,1,wx.EXPAND)
grid.Add(wx.StaticText(self,-1,"Command"),0,wx.BOTTOM+wx.RIGHT)
grid.Add(wx.StaticText(self, -1, _("Command")), 0, wx.BOTTOM+wx.RIGHT)
self.command=wx.TextCtrl(self,-1,"")
xbox=wx.BoxSizer(wx.HORIZONTAL)
xbox.Add(self.command,1,wx.EXPAND)
@ -1262,7 +1267,7 @@ class ButtonEdit(wx.Dialog):
self.macrob.Bind(wx.EVT_BUTTON,self.macrob_handler)
xbox.Add(self.macrob,0)
grid.Add(xbox)
grid.Add(wx.StaticText(self,-1,"Color"),0,wx.BOTTOM+wx.RIGHT)
grid.Add(wx.StaticText(self,-1, _("Color")),0,wx.BOTTOM+wx.RIGHT)
self.color=wx.TextCtrl(self,-1,"")
grid.Add(self.color,1,wx.EXPAND)
topsizer.Add(self.CreateSeparatedButtonSizer(wx.OK+wx.CANCEL),0,wx.EXPAND)