Landon, For the I18N stuff I'd like to find a way to do this that is not tied into the plug-in itself as there are many other classes used by a plug-in such as Swing panels etc which also need to have I18N.
What I propose is that we extend the current I18N class to support different categories of I18N resource bundles. At the simplest the following method would be added to the I18N class. public String getText(String category, String key) { I18N i18n = getInstance(category); if (i18n == null) { return key;// or code to create text based on key } else { return i18n.getText(key); } } The getInstance(category) method would create an I18N instance for the resource bundle that would be category ".language" or something like that. The non-static getText would be the same as the current static get() method but just work on an instance. So if I have my plug-ins in the com.revolsys.jump.foo package I'd create resources under /com/revolsys/jump/foo/language_xxx.properties And use com.revolsys.jump.foo as my category. Paul Sunburned Surveyor wrote: > I'm working on an extension of AbstractPlugIn that I would like to use > for most of my OpenJUMP PlugIns. At this time I only plan to add two > (2) things to this class: > > [1] The code from the OpenJUMP Wiki that allows a programmer to obtain > an i18n String from the plug-in. (This will be done using Java's > ResourceBundle class as shown in the wiki.) > > [2] Implement the IPlugInDependency interface to support plug-in dependencies. > > I'm going to make my SuperSelectToolboxPlugIn class extend this new > class so I can test the functionality. (I wanted to internationalize > the plug-in anyways.) > > Are there other useful additions that you have personally made to > OpenJUMP's basic PlugIn class? Do you find yourself adding the same > functionality to each of your plug-ins? > > I'd like any comments on this so I can design a well rounded and > comprehensive extension to the AbstractPlugIn class. > > I'm not suggesting this new class go into the core, but I will make it > available on my SurveyOS SourceForge site. > > The Sunburned Surveyor > > P.S. - I noticed that the i18n code on the OpenJUMP wiki creates an > instance of the ResourceBundle class in the plug-in's intialize > method. I wonder if this leads to uneccessary memory usage. Would it > be better to create the ResourceBundle class in the execute method? > (This might make setting an internationalized menu name a little > trickier, as it won't be available if we create the ResourceBundle in > the execute method instead of the intialize method.) > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Jump-pilot-devel mailing list > Jump-pilot-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel > ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Jump-pilot-devel mailing list Jump-pilot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel