changed:
-
----
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.com and editing the strings to translate on line: https://www.transifex.com/projects/p/puredata/resources/
Alternatively you can do it with a dedicated translation software, see "Using desktop software" at the bottom.
= 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 in Pd itself You can build and test your own files using that build system. First, you'll need to install GNU gettext. On Debian, Ubuntu, Mint, Fedora, !MacPorts, !HomeBrew, etc. the package is called '''gettext'''. On Mac OS X/Fink, the package is called '''gettext-tools'''. Also install git while you are at it. The package is usually called either '''git-core''' or '''git'''. Once you have those, you are ready to compile.
If your translation is new and that language does not already have a .po file, then you'll need to edit the '''pd-extended/po/Makefile.am''' to add your language code to the list. Open '''pd-extended/po/Makefile.am''' with any text editor. Near the top around line 18, you see a line that starts with `ALL_LINGUAS`. Add your language code to that line.
{{{
git clone git://pure-data.git.sourceforge.net/gitroot/pure-data/pd-extended.git
cd pd-extended
./autogen.sh
./configure
cd po
make
}}}
For the search plugin, you have to get that source separately, it has its own translation files and a [https://www.transifex.com/projects/p/puredata/resource/search-plugin/ separate section in Transifex]. To add a new language, edit '''search-plugin/po/Makefile''', find `ALL_LINGUAS` around line 7, and add your language code there.
{{{
svn co https://pure-data.svn.sourceforge.net/svnroot/pure-data/trunk/scripts/guiplugins/search-plugin
cd search-plugin/po
make
}}}
That will make all of the translation files. Now ''Download for use'' your [https://www.transifex.net/projects/p/puredata/resource/templatepot/ translation from Transifex], let's use the Japanese (ja) for an example. Rename the '''for_use_puredata_templatepot_ja.po''' file downloaded to '''ja.po''', and copy it into '''pd-extended/po''', overwriting the file that's there. Now you can make an updated version by running `make` again.
*On GNU/Linux, to install your generated '''ja.msg''' file, run: `sudo cp pd-extended/po/ja.msg /usr/lib/pd-extended/po/`
*On Mac OS X, to install your generated '''ja.msg''' file, right-click on the Pd-extended 0.43 app, and ''Show Package Contents''. Navigate to '''Contents/Resources/po''' and drop '''ja.msg''' into place there.
Next time you start Pd-extended 0.43, it should have your updated translation. If you want to see Pd-extended in a different language that what your computer is currently using, do this in the Terminal:
GNU/Linux:
{{{
LANG=en pd-extended
LANG=ja pd-extended
LANG=el pd-extended
}}}
Mac OS X:
{{{
LANG=en /Applications/Pd-extended.app/Contents/Resources/bin/pd
LANG=ko /Applications/Pd-extended.app/Contents/Resources/bin/pd
LANG=es_MX /Applications/Pd-extended.app/Contents/Resources/bin/pd
}}}
= Using desktop software =
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 [http://sourceforge.net/tracker2/?func=browse&group_id=55736&atid=478072 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.
*[http://gtranslator.sourceforge.net/ gtranslator] (GNOME GNU/Linux)
*[http://userbase.kde.org/Lokalize Lokalize] (KDE GNU/Linux)
*[http://www.triplespin.com/en/products/locfactoryeditor.html Loc Factory Editor] (Mac OS X)
*[http://www.poedit.net/ POedit] (Windows/Mac OS X/GNU/Linux)
*emacs po-mode included with gettext