Skip to main content

Localizing MyJxta2

Posted by joconner on December 15, 2004 at 9:39 PM PST

The JXTA group just released a new version of their product, version 2.3.2, code name "Imam Bayaldi." What a name! A quick Google search on Imam Bayaldi tells me that this is an eggplant and tomato recipe...but that's another subject.

One of the key demo applications included in the download is a program called MyJxta2. It's essentially a chat application, with lots of interesting features. My reason in bringing this up is that the author took some of my advice concerning internationalization. He separated his UI text from his core source code and placed the key/value pairs into a PropertyResourceBundle. This allows you, the user community, to localize the product into your language, whether that language be Spanish, German, French, or ...well, you get the picture.

How do you take advantage of this? How do you translate MyJXTA2?

  1. After downloading the source, find the resource bundle at
  2. Load the file into your favorite editor.
  3. Without changing the keys on the left, edit the values on the right to corresponding terms in your target language.
  4. Save the file as text_.properites or text__.properites if your language is specific to a particular region. Some languages, even English, can use different terms for the same object, ie car hood (en_US) and bonnet (en_UK). So sometimes the 3166 code is necessary.
  5. Use native2ascii to convert the file to \uXXXX notation if your character set is anything other than ISO 8859-1 or Latin-1.
  6. Submit the result to

Here are a few entries from


Editing this in my editor, and translating to Japanese, I might write this:


Now, what's next? We save the file of course. Since this is Japanese, we save the file as My editor can save files in a variety of charsets. Let's asssume I saved the file in the SJIS charset. Your editor may only save to your local charset. Once you save the file, there's just one problem...Japanese cannot be represented natively in Latin-1. So, I have to use the native2ascii tool to convert this file from a native encoding like Shift-JIS, JIS, or maybe even a Unicode encoding like UTF-8 to \uXXXX notation that is ASCII compatible. I can use this tool like so:

native2ascii -encoding SJIS

Now the file still contains the Japanese localized text, but it has been converted so that it can be used by the Java platform. Of course, it does look a little different in an editor:


Place this file ( or whatever you've created) into your source package for resources, build, and you have a MyJxta2 app capable of displaying its UI in Japanese. Impressive.

Hava some fun creating your own localization of MyJxta2. Don't forget to contribute back to the JXTA community by sending your localized file to!

Related Topics >>