Download

Important note as of 2008-08-25

I abandoned the internationalization project and started with a new approach. (See A new start: NI18N). The old software will remain available on this site for the time being.

Download

Download the complete software, including compiled jar file, sources, API documentation and a demonstration.

PbJarAll.zip 3.8 MB

ReadMe

Please find below an excerpt from the ReadMe file that is contained in the download bundle.


Copyright (C) 2006 - 2007 Piet Blok, this program is licensed under the terms of the Apache License Version 2.0


Author Piet Blok
Web site www.pbjar.org
Email

Caution

This software is not stable yet in the sense that changes are made without any notification and currently there is no versioning. If you decide that you want to use parts of it, you must realize that I do not keep a backup of earlier versions. You should archive the version that you are using.

Package names, class names, method names and signatures may change at any time.


Contents

Source code
API documentation
I18N demonstration


What classes

  1. A Look and Feel implementation EmptyX that is intended to be used as an Auxiliary Look and Feel and that itself actually does nothing.

    It offers a framework that may be used to implement logic that is to be executed at UI install time.

  2. An internationalization framework that is implemented using the EmptyX Look and Feel

    It provides for easy and dynamic switching between Locales, automatically updating localized values on visible components.

    It requires a minimum of effort to implement this approach in applications: instead of setting a localized value on a component, a specially constructed key must be set. When the localized value is a MessageFormat string, the variables can be easily put on the component as well.

  3. With the internationalization framework comes a ResourceBundle editor.

    This editor will scan the classpath at startup time for available ResourceBundles. The found bundles are presented in a tree where they can be selected for editing.

    While scanning the classpath for the available bundles, a dictionary is constructed that contains all default values found in the bundles. This dictionary can provide translation hints to assist the translator. For example, undoubtedly there will be bundles found containing the word "Open". If you are lucky, and indeed, if you are translating to a language like french, for which your JVM supplies localization you are lucky, the dictionary will find "Ouvrir" as a possible translation.

  4. Some experimental work on SVG. You need Batik to use it. See www.pbjar.org for a webstart demo.

  5. Some experimental work on the solution of sudoku's. See www.pbjar.org for a webstart demo.

  6. A lot of helper classes that are badly designed and that should be phased out.


About the demo's

There are two demonstrations. For both a .bat file is provided to start them. I am not familiar with Unix like operating systems. If you want these demo's to run on another platform than Windows, please create your own startup script. The .bat files have the following content:

  • RunI18N.bat java -cp Bundles;SampleBundles.jar;../PbJar.jar;%CLASSPATH% org.pbjar.i18n.demo.SampleGui

    Shows a GUI with a lot of standard JComponents. Menus are available to switch between Locales, Time Zones and Look and Feels. From the menu you may launch the BundleEditor.

    You may alter the behaviour of the EmptyXManager via a menu option (that displays a control panel). You may disable/enable that manager and add/remove installers. Just to show the capabilities of the EmptyX implementation, a SillyInstaller is also provided. This silly installer can interfere with tooltip text and button text. Of course this does not make much sense, so only included for demonstration purposes.

  • RunEditor.bat java -cp Bundles;SampleBundles.jar;../PbJar.jar;%CLASSPATH% org.pbjar.i18n.editor.BundleEditor

    Launches the BundleEditor. It will have a slow startup because it scans the entire classpath for ResourceBundles (progress is shown). Found bundles are assembled into a tree where you can select them for editing.

    Selected bundles will be shown in a table format where columns represent the locale for which you can edit and the rows represent a specific value from the bundle. Each cell is displayed with some background color, indicating its translation status.

    During the scanning process a dictionary is build of all default values with a link to the bundlename and key combination where they were found. This dictionary can provide translation hints.

    When saving a bundle you may optionally have comments added that specify:

  • Version
  • CopyRight
  • License
  • Email address
  • Website

  • Translations provided

    For some languages some bundles are (partly) translated. Apart from the Dutch translations, those translations are not of high quality. I made some of them from what I remember of my school days (almost fifty years ago), aided with dictionaries, and others by using free online translation engines. For instance, I wanted to include some Arabic and Japanese texts, just to see what happens in those locales. But I have no knowledge whatsoever of these languages (apart from knowing that Arabic is written from right to left). Please forgive me if I made horrible mistakes.

    As you may notice, I did not only translate bundles of my own packages, but also some bundles from the com.sun.internal.plaf packages when for some locales there seemed to be no translation, just to see if those translations were used on the places where I expected them. If you switch to Arabic, you may see Arabic text on some standard Swing components.


    Known limitations

    Apart from possible bugs in this implementation, Swing itself is not bug free and especially in the area of MultiLookAndFeel. I searched the Internet to find other implementations of Auxiliary Look and Feel but found none. That may explain the seemingly lack of interest to solve those bugs.