ok, so here's my attempt to make localization of the Java part of the Kindle Touch a bit easier.

This has been developed and tested on a Linux machine. The more interesting parts should work on Windows as well,
but I haven't tested it. This is a complete "toolchain" to extract localizable strings from jar files, and to generate
a JAR file containing the localizations. It consists of a bunch of Perl scripts. These scripts are not beautiful, they are not
written to be understood by the average user (heck, even I need time to understand them again), but they seem to do the job.
Some of the scripts also output a lot of noise which you can usually just ignore.

Maybe the simplest way to see how it should be used is to show an example.
Suppose that I have all the jars from the Kindle Touch in directory jars.kt, and all jars from a Kindle 4 in directory jars.k4.

A complete invocation of the toolkit could then look like this:

# STEP 1: find possible resource bundles
perl 1-find.pl bundles-kt.txt jars.kt
perl 1-find.pl bundles-k4.txt jars.k4

# STEP 2: extract identifiers
perl 2-extract.pl bundles-k4.txt jars.k4 >Kindle4
perl 2-extract.pl bundles-kt.txt jars.kt >KindleTouch

# STEP 3: create user-modifiable file.
perl 3-join.pl de_DE KindleTouch Kindle4 Kindle3Locs > translate_de_DE.txt

# STEP 4: actually translate the stuff (in this case translate_de_DE.txt)
# STEP 5: create locale JAR.
perl 4-create.pl de_DE translate_de_DE.txt locale-de_DE.jar zip


STEPS 1 and 2 are probably not required if you only want to translate. Their output is already contained in this package. Furthermore,
these scripts require adaptation to your environment, and are written for Linux only. In fact, don't use them unless you know what you
are doing.

STEP 3 will generate a file suitable for editing. Here is the syntax for it:
usage: 3-join.pl <locale> primary [secondary1 secondary2....]

Most of the arguments are there only to simplify your life. You *could* also run it as:
perl 3-join.pl "" KindleTouch > translate.txt

The idea of providing the target locale and additional input files is that the output will be tailored to your needs.
The script will try to find already available translations to your locale in all of the files, and add them as suggestions
(comments) to the output. This is meant to make your life easier, because you may be able to re-use existing translations.

"KindleTouch" refers to the resources present on your Kindle Touch.
"Kindle4" contains the automatically extracted localizations contained in the Kindle 4.
"Kindle3Locs" is meant to reuse previous localization efforts and contains localizations found on http://code.google.com/p/k3-loc/.
This file is produced from the (even more experimental than the rest) 0-k3loc2properties.pl
The abovementioned files are included in this package for convenience. If you're adventurous, you can regenerate them using
the scripts mentioned above.

STEP 4 is obviously the most important, and involves you editing the strings. The file contains a few informations at the
beginning which are meant to make your life easier. Remember that this is still an automatically generated file, and use
common sense. You may not need to translate every single item in it. If something is obviously not meant to be translated,
like URLs or commands, then either leave it at the default value, or delete the key alltogether. If in doubt, it's probably
best not to change things, and to manually find out where they appear and what the consequence of a translation is.

STEP 5 is the final step in creating the localization jar. The resulting file should be copied into /opt/amazon/ebook/lib/
on the device. Be sure to set the locale (first parameter) correctly. In an attempt to make this usable on Windows, the
last parameter is the zip executable to use and could, for instance, be something like "zip.exe". For Linux, leave it as it is.




I know the procedure is a bit hacky, the scripts look horrible and the command-line syntax is awkward. I also make no guarantees that
all possible things which can be localized have been found. A few may have been missed, but you can easily add them in step 4.
Still, I hope this thing is somewhat useful. There is no way to get around the actual translation work, but I tried hard to make it
as painless as possible. 
