Inserting an Internationalized String Into Source Code

See Also 

The Insert Internationalized String command enables you to add internationalization strings one at a time as you create the source.

To insert an internationalized string into your source code:

  1. In the Source Editor, put the insertion point at the location in the source file where you want to insert an internationalized string.
  2. Right-click the desired location and choose Tools and choose Internationalization and choose Insert Internationalized String from the contextual menu, or use the keyboard shortcut (Ctrl-Shift-J).

    The Insert Internationalized String dialog box appears allowing you to edit each string in the file consecutively. If no internationalization resource bundle exists for the file, you can click the New button to create a new properties file in which to save internationalized strings. To choose a different .properties file, click Browse.

  3. Click Format if you want to change the method used to generate the localized string.
  4. Click Arguments if you want to add arguments to the method call. You can only add arguments to the method call if you use the java.text.MessageFormat or org.openide.util.NbBundle.getMessage formats.
  5. Type in values for the Key and Value properties and click OK. The internationalized string is added to the source code at the cursor location.
See Also
Internationalizing a Single File
Setting an Internationalizated String With the Form Editor
Adding Arguments for Message Formats
Code Formats for Internationalized Strings
Editing Resource Bundles

Legal Notices