Fetching contributors…
Cannot retrieve contributors at this time
48 lines (29 sloc) 1.53 KB
Printrun Internationalization
Date: 06 August 2011
Author: Jonathan Marsden <>
Printrun is in the very early stages of being internationalized.
The 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 *.py printrun/*.py printrun/*/*.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/pronterface.po
cd locale/${newlanguage}/LC_MESSAGES/
# Edit the .po file to add messages for newlang
msgfmt -o pronterface.po
To update a previously created message catalog from the template, use :
msgmerge -U locale/fr/LC_MESSAGES/pronterface.po locale/pronterface.pot
As currently coded, the default location for these message catalogs is
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
Further automation for localization and packaging of Printrun would be
nice to see, but is not here yet.