Plug-in Review : ResourceBundle Editor

by Venu on July 14, 2007

An important facet of designing a program for use in different countries is the localization, or externalization, of text that is displayed by the program.

By externalizing strings, the text can be translated for different countries and languages without rebuilding the Java program.

The ResourceBundle Class in Java helps you to accomplish the above task.

Resource bundles contain locale-specific objects. When your program needs a locale-specific resource, a String for example, your program can load it from the resource bundle that is appropriate for the current user’s locale.

In this way, you can write program code that is largely independent of the user’s locale isolating most, if not all, of the locale-specific information in resource bundles.

More information on Java ResourceBundle here.

If your application is not using the Resource Bundle, you can always use the Eclipse “Externalize String” feature to move all the translatable strings into a properties file. In addition, the wizard also creates a helper class to access the resource bundle.

ResourceBundle Editor

Whenever you define a new “key value” data in one properties file, you have to add the same in all the other properties file. The same applies when you delete a key from one of the properties file. This process can get messy if you are modifying lot of files;

ResourceBundle Editor plug-in is a perfect companion to handle the above task with ease.

File Association

ResourceBundle Editor (RBE) is an editor extension for “.properties” file. By default, Eclipse opens the properties file in the Properties File Editor. You can either selectively open the properties file in RBE or set RBE as the default editor.

rbe1

User Interface

As mentioned earlier, RBE associates itself with a properties file in the Eclipse workspace. RBE is a tabbed editor; There is a “Properties” tab which is the primary tab used to add/modify new/existing key value pairs.

There is a default tab whose view is similar to the default properties editor. In addition to this, each locale specific file is also opened in a tab.

rbe2

The keys in the tree view are always sorted. You can quickly create a new key and associate values using the local specific text boxes. There are options even to rename a key and also to duplicate a key.

The view of the tree can either be flat or hierarchical. The default view can be controlled via the Preference page.

Also you can quickly create a new Resource bundle using the “New” tab.

rbe3

Other features

  • RBE can also report missing values. This can be identified by the icon status for each key in the tree view.
  • Can toggle between flat and hierarchical view of keys.
  • Supports Eclipse “nl” structure for I18N of plugins
  • Wizard for creating new resource bundle.
  • Non-ASCII character conversion to/from Unicode.

Issues

When you try to create a new key in an empty properties file, a NullPointerException is logged in the Error View. In order to avoid this, you should start with a file which has at least one key defined.

I couldn’t find how RBE reports duplicate and similar keys.

Summary

RBE is a must have plug-in if you are dealing with multiple properties file. Even otherwise, its a good alternative to the default Properties Editor.

Additional information about internationalized applications can be found in the following documents:

Download ResourceBundle Editor

Popularity: 48%

{ 0 comments… add one now }

There are no comments yet...

Kick things off by filling out the form below ↓

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>