Internationalizing a Single File
See Also
The Internationalize dialog box enables you to replace hard-coded strings
in a single file with internationalized strings. If you need to internationalize
several Java sources into one or more resource bundles, use the Internationalization
wizard.
To internationalize source code:
- In the Files or Projects window, right-click the class file you want to
internationalize and choose Tools > Internationalization
> Internationalize.
The Internationalize dialog box opens enabling you to edit each string
in the file consecutively.
- If a resource bundle already exists for the file, the
.properties file in which the strings are saved is displayed in
the Bundle Name field. The Replace String field also displays a preview
of the internationalized string.
- If no resource bundle exists for the file, the Bundle Name
and Replace String fields are empty. You can click the ellipsis (...) button
to specify a properties file or create a new one in which
to save internationalized strings.
- If you want to change the method used to generate the localized
string, click Format.
- If you want to add arguments to the method call, click Arguments. You
can only add arguments to the method call if you use the java.text.MessageFormat
or org.openide.util.NbBundle.getMessage formats.
- Check that the key and value are correct. By default, the Internationalize
dialog box gives the key the same name as the string being replaced.
- Click Replace to generate the internationalized string.
The next string to be internationalized is then displayed in the Value
text field.
- Click Skip to ignore any strings you do not want to internationalize.
The IDE automatically dismisses the dialog box once the last string has been
replaced.
- To get information about the highlighted string in the Source Editor, click
Info to see the name of the component containing the string and the property
that the string is associated with.
- See Also
- Internationalizing a Set of Files With the Internationalization Wizard
- Inserting an Internationalized String Into Source Code
- Adding Arguments for Message Formats
Legal Notices