Localizable Property Setting dialog box
Use the Localizable Property Setting dialog box to make a property localizable.
This dialog allows you to have the JBuilder design tools move the settings that needs
translating into a separate "resource" class or property file called a
ResourceBundle. Each ResourceBundle is a collection of key-value pairs.
The original "hardcoded" setting is replaced by a reference to the ResourceBundle
and the key. This is known as "resourcing".
When translating your application or applet,
you create a copy of the resource class for each language and translate the collected
strings of the copied class into the appropriate language for that market.
The Localizable Property Setting dialog box opens when you select ResourceBundle
from the context menu (right-click menu) and a property (that has been set) is
highlighted in the Inspector.
Store Text As String Constant
Select this option to store the property as a string constant in the source java file. This property will not be localized.
If this option is selected, the Store Text In Resource Bundle For Localization option is automatically deselected and all options in the Target ResourceBundle group are dimmed and unavailable.
If this option is selected for a string that was already localized, the hard-coded string is moved from the resource file to the source java file.
Store Text In ResourceBundle For Localization
Select this option to include the value specified for the selected property in the
resource file. If this option is selected, the Store Text As String Constant option is automatically deselected.
If the property is already in the ResourceBundle, this option will be
initially checked.
Target ResourceBundle
The following options allow you to customize how the string is placed in the ResourceBundle.
These options are available when the Store Text In ResourceBundle For Localization option is selected and are dimmed (unavailable) when the Store Text As String Constant option is selected.
ResourceBundle Name
Select the ResourceBundle where the hard-coded string should be moved to. If no ResourceBundles are found in your project when you start this wizard, the Create ResourceBundle dialog box displays. You can make additional
classes available in the list by clicking the New button, which displays the Create ResourceBundle dialog box.
If you have ResourceBundles that are in your project but do not have a reference in the class, they will not appear in this list. You can make these ResourceBundles available by adding the reference in the source. For example
public class MyFrame extends DecoratedFrame (
ResourceBundle myRes = ResourceBundle.getBundle("myPackage.MyRes");
// etc.
}
New
Opens the Create ResourceBundle dialog box,
which allows you to create a new resource bundle and make it available to the ResourceBundle Name
drop down list.
Resource Key
Specifies the name of the key that identifies the resourced string.
If the property has not already been resourced, the Resource Wizard automatically suggests a unique name for the key. It makes the suggestion based on the fields Generate Key From String Value or Generate Key From Component and Property Names.
Generate Key From String Value
Specifies that the Resource Wizard suggest a key based on the value of the hardcoded string. For example, if the string is "Click to continue", the suggested key might be "Click_to_continue". This option applies only for new properties that do not already appear in the ResourceBundle. Selecting this option deselects the Generate Key From Component and Property Names option.
Generate Key From Component and Property Names
Specifies that the Resource Wizard suggest a key based on the component and property that the string was used to set. For example, if the string is used in the following line of code:
continueButton.setLabel("Click to continue");
the suggested key might be "continueButton.Label".
This option applies only for new properties that do not already appear in the ResourceBundle.
Selecting this option deselects the Generate Key From String Value option.