Views
Now that Miller has started the process of incorporating the new GUI code into his repo, it seems that now is a good time to get some more/better translations. The new GUI has pretty good localization support using the standard gettext .PO format.
The easiest way to start translating Pd is by creating a (free) account at https://www.transifex.net and editing the strings to translate on line: https://www.transifex.net/projects/p/puredata/resource/templatepot/
Alternatively you can do it with a dedicated translation software, then read on.
Check http://pure-data.git.sourceforge.net/git/gitweb.cgi?p=pure-data/pure-data;a=tree;f=po to find all the of the existing translations and the template.pot for creating a new one. If you want to create a new locale, download template.pot, rename that to your locale in all lowercase (e.g. pt_br.po, ar.po, fr_ca.po, hr.po, etc.) and edit it with your favorite .po editor (see below). If you want to edit an existing translation, download the .po file and edit it.
Once you are done, then submit it back to the project. You can do that by submitting it to the pure-data Patch Tracker. If you login before submitting it, then you can automatically be notified of the status of your translation. If you have commit access, then commit the .po file directly to the repository.
Translation Software
Using a .po translation editor is highly recommended since its easy to make mistakes and hard to find them. This is all Free Software except Loc Factory Editor, which is only free as in beer.
-
gtranslator (GNOME GNU/Linux)
-
Lokalize (KDE GNU/Linux)
-
Loc Factory Editor (Mac OS X)
-
emacs po-mode included with gettext
Implementation
The translations start with the template.pot which is generated by xgettext. It reads the Tcl code looking for [_ "some text"]? constucts, which is how Tcl does localization. Each translation gets its own .po file named after the exact locale in all lowercase (e.g. en_gb.po). The Makefile then generates Tcl .msg files which Tcl's msgcat library uses for the localization text. Its Tcl's msgcat library that does the actual work in the GUI.
Testing Your Translation
Your translation editor should check your translation for errors, but the ultimate test is the translation build system. Currently its in the pd-gui-rewrite branch, you can get the files and run it by doing this in the Terminal:
git clone git://pure-data.git.sourceforge.net/pure-data/pure-data cd pure-data/po rm *.msg make
If your translation is new and that language does not already have a .po file, then you'll need to edit the pure-data/po/Makefile to add your locale. Open pure-data/po/Makefile with any text editor. Near the top around line 18, you see a line that starts with ALL_LINGUAS. Add your locale name to that line.