I ran into some trouble with OpenJUMP’s I18N class. I’m having trouble locating the properties files located in the Super Select Tool JAR file with the I18N Class. The content on the OpenJUMP I18N wiki page got me to thinking about other options for I18N in OpenJUMP. I’ve take a closer look at Java’s ResourceBundle class and I like the basic concept of using the class for I18N in OpenJUMP.
I’ve decided to implement a class that is very similar to the ResourcBundle class for use in the Super Select Tool and my other plug-ins for OpenJUMP. This class will differ from the standard ResourceBundle class in at least three (3) of important ways:
The location of the text files containing the translated Strings will be passed to the class directly, wither as a File object or as an InputStream. This will avoid the use of the default searching mechanism in the standard ResourceBundle class and will give the programmer control over where exactly to find the translation files for use in the ResourceBundle.
The ResourceBundle will only allow access to translated Strings, and not other types of objects. This will simplify the classes use.
The class will use YAML text files for persistent storage of the translated Strings. This will allow the developer to store more than a key and value for each translated String. They will also be able to store a description of the translates String, translation notes, and the name of the GUI class using the translated String.
This class will be called YAMLResourceBundle. It will have at least two (2) support classes, YAMLResourceBundleFactory and YAMLResourceBundleUtilities. The utility class will allow client code to search for Strings based on the contents of the description, translation notes, or GUI class for each translated String.
The Sunburned Surveyor (A.K.A. - Landon Blake)
I’ve decided to implement a class that is very similar to the ResourcBundle class for use in the Super Select Tool and my other plug-ins for OpenJUMP. This class will differ from the standard ResourceBundle class in at least three (3) of important ways:
The location of the text files containing the translated Strings will be passed to the class directly, wither as a File object or as an InputStream. This will avoid the use of the default searching mechanism in the standard ResourceBundle class and will give the programmer control over where exactly to find the translation files for use in the ResourceBundle.
The ResourceBundle will only allow access to translated Strings, and not other types of objects. This will simplify the classes use.
The class will use YAML text files for persistent storage of the translated Strings. This will allow the developer to store more than a key and value for each translated String. They will also be able to store a description of the translates String, translation notes, and the name of the GUI class using the translated String.
This class will be called YAMLResourceBundle. It will have at least two (2) support classes, YAMLResourceBundleFactory and YAMLResourceBundleUtilities. The utility class will allow client code to search for Strings based on the contents of the description, translation notes, or GUI class for each translated String.
The Sunburned Surveyor (A.K.A. - Landon Blake)