Adding Arguments for Message Formats

The java.text.MessageFormat code format lets you use strings that are constructed dynamically at runtime. The dynamically added elements are stored in an array of objects, which is passed as a parameter to java.text.MessageFormat. You can use the Message Format Arguments dialog box to specify the values of these objects.

To enter substitution parameters for a message format:

  1. In the Internationalize dialog box, click the Format button.
  2. Choose a format with {arguments} (e.g. one starting with MessageFormat) from the Replace Code Format combo box and click OK.
  3. In the Internationalize dialog box, click the Arguments button.
  4. Click the Add button next to the Arguments text field.

    A series of parameters, beginning with 0, is added to the text field.

  5. Type a value for the parameter in the Code field. Click Add to add additional parameter or OK to close the dialog box. To remove an argument, select it in the Arguments text field and click Remove.
  6. Click OK when you are done.

The arguments you supply are substutued for {arguments} wildcard of the format:
java.text.MessageFormat(java.util.ResourceBundle.getBundle("bundle name").getString("key"), new Object[] {arg1, arg2, arg3})

See the documentation for java.text.MessageFormat for more information on using localized strings with parameters.

See also
Code Formats for Internationalized Strings
Internationalizing a Single File
Internationalizing a Set of Files With the Internationalization Wizard
Setting an Internationalizated String With the Form Editor

Legal Notices