General
RB Manager
RB Reporter

 

Step 4. Populating the Bundle with Resources

Working within a Group

In the tutorial file, following the process described in the previous step, I created a group called 'Questions' and gave it a comment. To view the group that you created, make sure that the base class at the top of the file tree to the left is selected, press the 'Groups' tab on the right, and select your group name from the drop down menu. With any luck, you will see something like this:

From this view, there are several options that are to be found in the six buttons to the lower right. We are now going to create a resource. This can be accomplished by either pressing the button 'Create Resource' or selecting 'Add New Resource...' from the 'Options' menu at the top of the screen.

Filling in Resource Information

Once you follow one of the above two steps, you should see a dialog similar to the following:

The group shown is the one currently being viewed when you clicked on the 'Create Resource' button. If you used the menu to bring up this dialog, it may be a different group. You may move the resource to any group you wish by changing the value in this drop down box. Both the entry key and the translation fields are required information. These make up the lookup value and the translation value respectively stored in your bundle. The comment field is there in order to aid those who will be translating your work into other languages. This field provides a way for you to describe the context of this particular resource.

There are a few ways to create the resource once the information is entered. Pressing 'Create' will add the resource and close the dialog. If you wish to continue creating resources after the current one, pressing 'Create & Continue' will create the resource, clear the information you have just entered, and allow you to enter in a new resource. Pressing 'Cancel' will close the dialog box and ignore any information currently entered. As a short cut, you can also hit enter from any of the text boxes but 'Translation'. This will create the resource. Pressing enter from the translation text box, creates a translation that spans multiple lines of text.

A sample resource creation is show as follows:

Using 'Look-ups'

Resource bundles provide a way of translating contextual information as well. For instance, what if I wanted a translation asking the user how old they were, and I wanted to ask it with their name inserted into the question. The placement of their name might be different in different languages. This is the reason for 'look-ups'. The java.text package defines a way for implementing these look-ups using numbers surrounded by curly braces. Thus, I might want to create a resource like the one below:

Once you enter anything into your translation surrounded by curly braces and change the focus away from the translation field, the dialog box will update itself with areas for you to enter descriptions of the look-ups you have entered. This feature of RBManager allows future translators to understand the context of each look-up.

Editing the Resources

From the 'Groups' tab view, you can at any time edit the default values for a resource. As you enter in new resources they will appear in the group view as shown:

Double clicking on a resource will bring a dialog box up similar to the one for creating a resource. Remember that it is only from this view that you will be able to change the resource in a way that will effect the entire bundle. Thus it is only in this view that you can change the resource's group, key name, and default translation and comment.

Back to Step 3 -or- Forward to Step 5

Copyright 2000-2001 International Business Machines, All Rights Reserved